inspektors/robot/include/common.h
2018-01-19 18:13:16 +02:00

13 lines
341 B
C

#ifndef COMMON_H
#define COMMON_H
#include <stdint.h>
#define BIT(mask) (1 << (mask))
#define SET(var, mask) ((var) |= (uint8_t)BIT(mask))
#define CLR(var, mask) ((var) &= (uint8_t)~(BIT(mask)))
#define CHK(var, mask) ((var) & (uint8_t)BIT(mask))
#define TOG(var, mask) ((var) ^= (uint8_t)BIT(mask))
#endif /* COMMON_H */