OS  v7.3.3
Documentation
Loading...
Searching...
No Matches

APIs to handle entry/exit actions in Critical sections. More...

Collaboration diagram for Critical:

Typedefs

typedef void(* qInt_Restorer_t) (qUINT32_t arg1)
 Function called by qCritical_Exit() to restore interrupts.
 
typedef qUINT32_t(* qInt_Disabler_t) (void)
 Function called by qCritical_Enter() to disable interrupts.
 

Functions

void qCritical_Enter (void)
 Enter a critical section. This function invokes the Disabler function if available.
 
void qCritical_Exit (void)
 Exit a critical section. This function invokes the Enabler function if available.
 
qBool_t qCritical_SetInterruptsED (const qInt_Restorer_t rFcn, const qInt_Disabler_t dFcn)
 Set the hardware-specific code for global interrupt enable/disable. Setting this allows you to communicate safely from Interrupts using queued notifications or qQueues. Example :
 

Detailed Description

APIs to handle entry/exit actions in Critical sections.

Typedef Documentation

◆ qInt_Disabler_t

typedef qUINT32_t(* qInt_Disabler_t) (void)

Function called by qCritical_Enter() to disable interrupts.

Note
User should use bare-metal code to implement this function.
User should return the current interrupt configuration to be saved by the kernel. Example :
qUINT32_t BSP_InterruptDisabler( void ) {
qUINT32_t currentMask;
currentMask = HAL_InterruptGetMask( savedMask );
HAL_DisableInterrupts();
return currentMask;
}
uint32_t qUINT32_t
Unsigned integer type with width of exactly 32 bits respectively.
Definition qtypes.h:48
Returns
The current interrupt configuration (mask). The kernel will retain this value until the critical section is exited

◆ qInt_Restorer_t

typedef void(* qInt_Restorer_t) (qUINT32_t arg1)

Function called by qCritical_Exit() to restore interrupts.

Note
User should use bare-metal code to implement this function.
The kernel passes the previously saved interrupt configuration as input argument. The user is responsible for taking this argument to restore the saved interrupt setup. Example :
void BSP_InterruptRestorer( qUINT32_t savedMask ) {
HAL_InterruptSetMask( savedMask );
HAL_EnableInterrupts();
}
Parameters
[in]savedMaskThe interrupt configuration saved by the "Disabler" function

Function Documentation

◆ qCritical_Enter()

void qCritical_Enter ( void )

Enter a critical section. This function invokes the Disabler function if available.

Note
Please see qCritical_SetInterruptsED()

◆ qCritical_Exit()

void qCritical_Exit ( void )

Exit a critical section. This function invokes the Enabler function if available.

Note
Please see qCritical_SetInterruptsED()

◆ qCritical_SetInterruptsED()

qBool_t qCritical_SetInterruptsED ( const qInt_Restorer_t rFcn,
const qInt_Disabler_t dFcn )

Set the hardware-specific code for global interrupt enable/disable. Setting this allows you to communicate safely from Interrupts using queued notifications or qQueues. Example :

void qCritical_SetInterruptsED( BSP_InterruptRestorer, BSP_InterruptDisabler );
qBool_t qCritical_SetInterruptsED(const qInt_Restorer_t rFcn, const qInt_Disabler_t dFcn)
Set the hardware-specific code for global interrupt enable/disable. Setting this allows you to commun...
Definition qcritical.c:39
Parameters
[in]rFcnThe function with hardware specific code that enables or restores interrupts.
[in]dFcnThe function with hardware specific code that disables interrupts.
Returns
qTrue on success. Otherwise return qFalse.