37 #ifndef UTILS_INTERRUPT_INTERRUPT_H 38 #define UTILS_INTERRUPT_INTERRUPT_H 89 # define irq_initialize_vectors() \ 110 # define irq_register_handler(int_num, int_prio) \ 111 NVIC_ClearPendingIRQ( (IRQn_Type)int_num); \ 112 NVIC_SetPriority( (IRQn_Type)int_num, int_prio); \ 113 NVIC_EnableIRQ( (IRQn_Type)int_num); \ 117 # define cpu_irq_enable() \ 119 g_interrupt_enabled = true; \ 123 # define cpu_irq_disable() \ 127 g_interrupt_enabled = false; \ 132 #if !defined(__DOXYGEN__) 136 #define cpu_irq_is_enabled() (__get_PRIMASK() == 0) 167 #define Enable_global_interrupt() cpu_irq_enable() 168 #define Disable_global_interrupt() cpu_irq_disable() 169 #define Is_global_interrupt_enabled() cpu_irq_is_enabled() #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.
static irqflags_t cpu_irq_save(void)
Get and clear the global interrupt flags.
volatile bool g_interrupt_enabled
static void cpu_irq_restore(irqflags_t flags)
Restore global interrupt flags.
Commonly used includes, types and macros.
Atmel part identification macros.
void cpu_irq_leave_critical(void)
static bool cpu_irq_is_enabled_flags(irqflags_t flags)
Check if interrupts are globally enabled in supplied flags.
static volatile bool cpu_irq_prev_interrupt_state
void cpu_irq_enter_critical(void)
uint32_t irqflags_t
Type used for holding state of interrupt flag.
#define cpu_irq_enable()
Enable interrupts globally.