34 #ifndef _UTIL_ATOMIC_H_
35 #define _UTIL_ATOMIC_H_ 1
40 #if !defined(__DOXYGEN__)
42 static __inline__
uint8_t __iSeiRetVal(
void)
48 static __inline__
uint8_t __iCliRetVal(
void)
54 static __inline__
void __iSeiParam(
const uint8_t *__s)
57 __asm__
volatile (
"" :::
"memory");
61 static __inline__
void __iCliParam(
const uint8_t *__s)
64 __asm__
volatile (
"" :::
"memory");
68 static __inline__
void __iRestore(
const uint8_t *__s)
71 __asm__
volatile (
"" :::
"memory");
202 #if defined(__DOXYGEN__)
203 #define ATOMIC_BLOCK(type)
205 #define ATOMIC_BLOCK(type) for ( type, __ToDo = __iCliRetVal(); \
206 __ToDo ; __ToDo = 0 )
223 #if defined(__DOXYGEN__)
224 #define NONATOMIC_BLOCK(type)
226 #define NONATOMIC_BLOCK(type) for ( type, __ToDo = __iSeiRetVal(); \
227 __ToDo ; __ToDo = 0 )
241 #if defined(__DOXYGEN__)
242 #define ATOMIC_RESTORESTATE
244 #define ATOMIC_RESTORESTATE uint8_t sreg_save \
245 __attribute__((__cleanup__(__iRestore))) = SREG
262 #if defined(__DOXYGEN__)
263 #define ATOMIC_FORCEON
265 #define ATOMIC_FORCEON uint8_t sreg_save \
266 __attribute__((__cleanup__(__iSeiParam))) = 0
280 #if defined(__DOXYGEN__)
281 #define NONATOMIC_RESTORESTATE
283 #define NONATOMIC_RESTORESTATE uint8_t sreg_save \
284 __attribute__((__cleanup__(__iRestore))) = SREG
301 #if defined(__DOXYGEN__)
302 #define NONATOMIC_FORCEOFF
304 #define NONATOMIC_FORCEOFF uint8_t sreg_save \
305 __attribute__((__cleanup__(__iCliParam))) = 0
#define sei()
Definition: interrupt.h:79
#define cli()
Definition: interrupt.h:97
unsigned char uint8_t
Definition: stdint.h:80