Safe nesting interrupt disable/enable API. More...
![]() |
Functions | |
__STATIC_INLINE uint32_t | INT_Disable (void) |
Disable interrupts. | |
__STATIC_INLINE uint32_t | INT_Enable (void) |
Enable interrupts. | |
Variables | |
uint32_t | INT_LockCnt = 0 |
Safe nesting interrupt disable/enable API.
This module contains functions to safely disable and enable interrupts at cpu level. INT_Disable() disables interrupts and increments a lock level counter. INT_Enable() decrements the lock level counter and enable interrupts if the counter was decremented to zero.
These functions would normally be used to secure critical regions.
These functions should also be used inside interrupt handlers:
* void SysTick_Handler(void) * { * INT_Disable(); * . * . * . * INT_Enable(); * } *
__STATIC_INLINE uint32_t INT_Disable | ( | void | ) |
Disable interrupts.
Disable interrupts and increment lock level counter.
Definition at line 72 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 95 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 69 of file em_int.c.
Referenced by INT_Disable(), and INT_Enable().