APIs to handle entry/exit actions in Critical sections.
More...
|
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 :
|
|
APIs to handle entry/exit actions in Critical sections.
◆ qInt_Disabler_t
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 :
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] | savedMask | The interrupt configuration saved by the "Disabler" function |
◆ qCritical_Enter()
void qCritical_Enter |
( |
void | | ) |
|
◆ qCritical_Exit()
void qCritical_Exit |
( |
void | | ) |
|
◆ qCritical_SetInterruptsED()
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 :
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] | rFcn | The function with hardware specific code that enables or restores interrupts. |
[in] | dFcn | The function with hardware specific code that disables interrupts. |
- Returns
- qTrue on success. Otherwise return qFalse.