INT
[EM_Library]

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

Collaboration diagram for INT:

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

Detailed Description

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

Function Documentation

__STATIC_INLINE uint32_t INT_Disable ( void   ) 

Disable interrupts.

Disable interrupts and increment lock level counter.

Returns:
The resulting interrupt nesting level.

Definition at line 72 of file em_int.h.

References INT_LockCnt.

__STATIC_INLINE uint32_t INT_Enable ( void   ) 

Enable interrupts.

Returns:
The resulting interrupt nesting level.

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

Definition at line 95 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 69 of file em_int.c.

Referenced by INT_Disable(), and INT_Enable().