34#ifndef _UTIL_ATOMIC_H_
35#define _UTIL_ATOMIC_H_ 1
40#if !defined(__DOXYGEN__)
42static __inline__
uint8_t __iSeiRetVal(
void)
48static __inline__
uint8_t __iCliRetVal(
void)
54static __inline__
void __iSeiParam(
const uint8_t *__s)
57 __asm__
volatile (
"" :::
"memory");
61static __inline__
void __iCliParam(
const uint8_t *__s)
64 __asm__
volatile (
"" :::
"memory");
68static __inline__
void __iRestore(
const uint8_t *__s)
71 __asm__
volatile (
"" :::
"memory");
206#if defined(__DOXYGEN__)
207#define ATOMIC_BLOCK(type)
209#define ATOMIC_BLOCK(type) for ( type, __ToDo = __iCliRetVal(); \
210 __ToDo ; __ToDo = 0 )
227#if defined(__DOXYGEN__)
228#define NONATOMIC_BLOCK(type)
230#define NONATOMIC_BLOCK(type) for ( type, __ToDo = __iSeiRetVal(); \
231 __ToDo ; __ToDo = 0 )
245#if defined(__DOXYGEN__)
246#define ATOMIC_RESTORESTATE
248#define ATOMIC_RESTORESTATE uint8_t sreg_save \
249 __attribute__((__cleanup__(__iRestore))) = SREG
267#if defined(__DOXYGEN__)
268#define ATOMIC_FORCEON
270#define ATOMIC_FORCEON uint8_t sreg_save \
271 __attribute__((__cleanup__(__iSeiParam))) = 0
285#if defined(__DOXYGEN__)
286#define NONATOMIC_RESTORESTATE
288#define NONATOMIC_RESTORESTATE uint8_t sreg_save \
289 __attribute__((__cleanup__(__iRestore))) = SREG
307#if defined(__DOXYGEN__)
308#define NONATOMIC_FORCEOFF
310#define NONATOMIC_FORCEOFF uint8_t sreg_save \
311 __attribute__((__cleanup__(__iCliParam))) = 0
#define cli()
Definition: interrupt.h:90
#define sei()
Definition: interrupt.h:76
unsigned char uint8_t
Definition: stdint.h:83