EFM32 Leopard Gecko Software Documentation  efm32lg-doc-4.2.1

Safe nesting of interrupt disable/enable API. More...

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
 

Detailed Description

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();
*  }
* 

Function Documentation

Variable Documentation

uint32_t INT_LockCnt = 0

Interrupt lock level counter. Set to zero initially as we normally enter main with interrupts enabled

Definition at line 70 of file em_int.c.

Referenced by INT_Disable(), and INT_Enable().