EFM32 Pearl Gecko 12 Software Documentation
efm32pg12-doc-5.1.2
|
Safe nesting of interrupt disable/enable API.
This module contains functions to safely disable and enable interrupts at CPU level. INT_Disable() disables interrupts globally and increments a lock level counter (counting semaphore). INT_Enable() decrements the lock level counter and enable interrupts if the counter reaches zero.
These functions would normally be used to secure critical regions, and to make sure that a critical section that calls into another critical section does not unintentionally terminate the callee critical section.
These functions should also be used inside interrupt handlers:
* void SysTick_Handler(void) * { * INT_Disable(); * . * . * . * INT_Enable(); * } *
Functions | |
__STATIC_INLINE uint32_t | INT_Disable (void) |
Disable interrupts. More... | |
__STATIC_INLINE uint32_t | INT_Enable (void) |
Enable interrupts. More... | |
Variables | |
uint32_t | INT_LockCnt = 0 |
__STATIC_INLINE uint32_t INT_Disable | ( | void | ) |
Disable interrupts.
Disable interrupts and increment lock level counter.
Definition at line 78 of file em_int.h.
References INT_LockCnt.
__STATIC_INLINE uint32_t INT_Enable | ( | void | ) |
Enable interrupts.
Decrement interrupt lock level counter and enable interrupts if counter reached zero.
Definition at line 105 of file em_int.h.
References INT_LockCnt.
uint32_t INT_LockCnt = 0 |
Interrupt lock level counter. Set to zero initially as we normally enter main with interrupts enabled
Definition at line 75 of file em_int.c.
Referenced by INT_Disable(), and INT_Enable().