EFR32 Mighty Gecko 1 Software Documentation  efr32mg1-doc-5.1.2

Detailed Description

Safe nesting of interrupt disable/enable API.

Deprecated:
These functions are deprecated and marked for removal in a later release. Please use the CORE module instead. See Porting from em_int for information on how to convert existing code bases to use CORE.

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
 

Function Documentation

__STATIC_INLINE uint32_t INT_Disable ( void  )

Disable interrupts.

Deprecated:
This function is deprecated and marked for removal in a later release. Please use the new CORE module instead.

Disable interrupts and increment lock level counter.

Returns
The resulting interrupt disable nesting level.

Definition at line 78 of file em_int.h.

References INT_LockCnt.

__STATIC_INLINE uint32_t INT_Enable ( void  )

Enable interrupts.

Deprecated:
This function is deprecated and marked for removal in a later release. Please use the new CORE module instead.
Returns
The resulting interrupt disable nesting level.

Decrement interrupt lock level counter and enable interrupts if counter reached zero.

Definition at line 105 of file em_int.h.

References INT_LockCnt.

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 75 of file em_int.c.

Referenced by INT_Disable(), and INT_Enable().