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

23 lines
316 B
C
Executable File

#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; }