13 lines
341 B
C
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 */
|