Mbed OS Reference
Loading...
Searching...
No Matches
critical section function

Functions

bool core_util_are_interrupts_enabled (void)
 Determine the current interrupts enabled state. More...
 
bool core_util_is_isr_active (void)
 Determine if this code is executing from an interrupt. More...
 
void core_util_critical_section_enter (void)
 Mark the start of a critical section. More...
 
void core_util_critical_section_exit (void)
 Mark the end of a critical section. More...
 
bool core_util_in_critical_section (void)
 Determine if we are currently in a critical section. More...
 

Detailed Description

Function Documentation

◆ core_util_are_interrupts_enabled()

bool core_util_are_interrupts_enabled ( void  )

Determine the current interrupts enabled state.

This function can be called to determine whether or not interrupts are currently enabled.

Note
NOTE: This function works for both cortex-A and cortex-M, although the underlying implementation differs.
Returns
true if interrupts are enabled, false otherwise

◆ core_util_is_isr_active()

bool core_util_is_isr_active ( void  )

Determine if this code is executing from an interrupt.

This function can be called to determine if the code is running on interrupt context.

Note
NOTE: This function works for both cortex-A and cortex-M, although the underlying implementation differs.
Returns
true if in an isr, false otherwise

◆ core_util_critical_section_enter()

void core_util_critical_section_enter ( void  )

Mark the start of a critical section.

This function should be called to mark the start of a critical section of code.

Note
NOTES: 1) The use of this style of critical section is targetted at C based implementations. 2) These critical sections can be nested. 3) The interrupt enable state on entry to the first critical section (of a nested set, or single section) will be preserved on exit from the section. 4) This implementation will currently only work on code running in privileged mode.

◆ core_util_critical_section_exit()

void core_util_critical_section_exit ( void  )

Mark the end of a critical section.

This function should be called to mark the end of a critical section of code.

Note
NOTES: 1) The use of this style of critical section is targetted at C based implementations. 2) These critical sections can be nested. 3) The interrupt enable state on entry to the first critical section (of a nested set, or single section) will be preserved on exit from the section. 4) This implementation will currently only work on code running in privileged mode.

◆ core_util_in_critical_section()

bool core_util_in_critical_section ( void  )

Determine if we are currently in a critical section.

Returns
true if in a critical section, false otherwise.