39 __attribute__((always_inline))
static inline unsigned int irq_disable(
void)
43 "in %[dest], __SREG__" "\n\t"
55 __attribute__((always_inline))
static inline unsigned int irq_enable(
void)
59 "in %[dest], __SREG__" "\n\t"
71 __attribute__((always_inline))
static inline void irq_restore(
unsigned int _state)
73 uint8_t state = (uint8_t)_state;
86 "sbrc %[state], 7" "\n\t"
97 __attribute__((always_inline))
static inline bool irq_is_in(
void)
101 __asm__
volatile (
"" : : :
"memory");
113 "in %[dest], __SREG__" "\n\t"
118 return mask & (1 << 7);
144 #define AVR8_ISR(vector, function, ...) \
145 ISR(vector, ISR_BLOCK) \
148 function(__VA_ARGS__); \
static unsigned int irq_disable(void)
Disable all maskable interrupts.
static void irq_restore(unsigned int _state)
Restore the state of the IRQ flags.
static bool irq_is_enabled(void)
Test if interrupts are currently enabled.
static bool irq_is_in(void)
See if the current context is inside an ISR.
static unsigned int irq_enable(void)
Enable all maskable interrupts.
stdio wrapper to extend the C libs stdio
#define avr8_state_irq_count
Definition for SRAM.