INTEMLIB

Detailed Description

Safe nesting of interrupt disable/enable API.

Deprecated:
These functions are deprecated and marked for removal in a later release. 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 the CPU level. INT_Disable() disables interrupts globally and increments a lock level counter (counting semaphore). INT_Enable() decrements the lock level counter and enables 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.
__STATIC_INLINE uint32_t INT_Enable (void)
Enable interrupts.

Variables

uint32_t INT_LockCnt = 0

Function Documentation

__STATIC_INLINE uint32_t INT_Disable ( void )

Disable interrupts.

Deprecated:
Deprecated and marked for removal in a later release. Use new CORE module instead.

Disable interrupts and increment lock level counter.

Returns
Resulting interrupt disable nesting level.

Definition at line 77 of file em_int.h .

References INT_LockCnt .

__STATIC_INLINE uint32_t INT_Enable ( void )

Enable interrupts.

Deprecated:
Deprecated and marked for removal in a later release. Use the new CORE module instead.
Returns
Resulting interrupt disable nesting level.

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

Definition at line 103 of file em_int.h .

References INT_LockCnt .

Variable Documentation

uint32_t INT_LockCnt = 0

An interrupt lock level counter. Set to zero initially because main is normally entered with interrupts enabled.

Definition at line 74 of file em_int.c .

Referenced by INT_Disable() , and INT_Enable() .