43 __attribute__((always_inline))
static inline unsigned int irq_disable(
void)
47 "in %[dest], __SREG__" "\n\t"
59 __attribute__((always_inline))
static inline unsigned int irq_enable(
void)
63 "in %[dest], __SREG__" "\n\t"
75 __attribute__((always_inline))
static inline void irq_restore(
unsigned int _state)
77 uint8_t state = (uint8_t)_state;
90 "sbrc %[state], 7" "\n\t"
101 __attribute__((always_inline))
static inline bool irq_is_in(
void)
105 __asm__
volatile (
"" : : :
"memory");
117 "in %[dest], __SREG__" "\n\t"
122 return mask & (1 << 7);
148 #define AVR8_ISR(vector, function, ...) \
149 ISR(vector, ISR_BLOCK) \
152 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.
#define avr8_state_irq_count
Definition for SRAM.
stdio wrapper to extend the C libs stdio