avr-fw-modules/core/include/sys/atomic.h

23 lines
316 B
C
Raw Normal View History

2017-09-27 13:25:39 +02:00
#pragma once
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>
#include <sys/arch/atomic.h>
#define ATOM_SET_BIT(atom,bit) { \
ATOMIC \
atom |= (1L<<bit); }
#define ATOM_CLEAR_BIT(atom,bit) { \
ATOMIC \
atom &= ~(1L<<bit); }
#define ATOMIC_SET(atom,value) { \
ATOMIC \
atom = value; }