EFR32 Mighty Gecko 1 Software Documentation  efr32mg1-doc-5.1.2
em_int.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef EM_INT_H
34 #define EM_INT_H
35 
36 #include "em_device.h"
37 
38 extern uint32_t INT_LockCnt;
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
45 #ifndef UINT32_MAX
46 #define UINT32_MAX ((uint32_t)(0xFFFFFFFF))
47 #endif
48 
49 #warning "The INT module is deprecated and marked for removal in a later release. Please use the new CORE module instead. See \"Porting from em_int\" in the CORE documentation for instructions."
50 
53 /***************************************************************************/
58 /***************************************************************************/
63 /***************************************************************************/
78 __STATIC_INLINE uint32_t INT_Disable(void)
79 {
80  __disable_irq();
81  if (INT_LockCnt < UINT32_MAX)
82  {
83  INT_LockCnt++;
84  }
85 
86  return INT_LockCnt;
87 }
88 
89 /***************************************************************************/
105 __STATIC_INLINE uint32_t INT_Enable(void)
106 {
107  uint32_t retVal;
108 
109  if (INT_LockCnt > 0)
110  {
111  INT_LockCnt--;
112  retVal = INT_LockCnt;
113  if (retVal == 0)
114  {
115  __enable_irq();
116  }
117  return retVal;
118  }
119  else
120  {
121  return 0;
122  }
123 }
124 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* EM_INT_H */
__STATIC_INLINE uint32_t INT_Enable(void)
Enable interrupts.
Definition: em_int.h:105
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
uint32_t INT_LockCnt
Definition: em_int.c:75
__STATIC_INLINE uint32_t INT_Disable(void)
Disable interrupts.
Definition: em_int.h:78