SAM4SD32 (SAM4S-EK2)
Loading...
Searching...
No Matches
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 */
44volatile 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
void cpu_irq_enter_critical(void)
static volatile bool cpu_irq_prev_interrupt_state
#define cpu_irq_disable()
Disable interrupts globally.
static volatile uint32_t cpu_irq_critical_section_counter
void cpu_irq_leave_critical(void)
#define cpu_irq_is_enabled()
Check if interrupts are globally enabled.
#define cpu_irq_enable()
Enable interrupts globally.
Global interrupt management for SAM D20, SAM3 and SAM4 (NVIC based).