interrupt_sam_nvic.c
Go to the documentation of this file.
1 
33 /*
34  * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35  */
36 
37 #include "interrupt_sam_nvic.h"
38 
39 #if !defined(__DOXYGEN__)
40 /* Deprecated - global flag to determine the global interrupt state. Required by
41  * QTouch library, however new applications should use cpu_irq_is_enabled()
42  * which probes the true global interrupt state from the CPU special registers.
43  */
44 volatile bool g_interrupt_enabled = true;
45 #endif
46 
48 {
50  if (cpu_irq_is_enabled()) {
53  } else {
54  /* Make sure the to save the prev state as false */
56  }
57 
58  }
59 
61 }
62 
64 {
65  /* Check if the user is trying to leave a critical section when not in a critical section */
67 
69 
70  /* Only enable global interrupts when the counter reaches 0 and the state of the global interrupt flag
71  was enabled when entering critical state */
74  }
75 }
76 
#define cpu_irq_disable()
Disable interrupts globally.
static volatile uint32_t cpu_irq_critical_section_counter
#define cpu_irq_is_enabled()
Check if interrupts are globally enabled.
volatile bool g_interrupt_enabled
Global interrupt management for SAM D20, SAM3 and SAM4 (NVIC based)
void cpu_irq_leave_critical(void)
static volatile bool cpu_irq_prev_interrupt_state
void cpu_irq_enter_critical(void)
#define Assert(expr)
This macro is used to test fatal errors.
Definition: compiler.h:196
#define cpu_irq_enable()
Enable interrupts globally.


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57