more defines

This commit is contained in:
iceman1001 2019-12-24 11:30:46 +01:00
parent e701022257
commit 0219c6b125

View file

@ -141,4 +141,10 @@ extern int DBGLEVEL;
# define DEC2BCD(dec) HornerScheme(dec, 10, 0x10)
#endif
// bit stream operations
#define TEST_BIT(data, i) (*(data + (i / 8)) >> (7 - (i % 8))) & 1
#define SET_BIT(data, i) *(data + (i / 8)) |= (1 << (7 - (i % 8)))
#define CLEAR_BIT(data, i) *(data + (i / 8)) &= ~(1 << (7 - (i % 8)))
#define FLIP_BIT(data, i) *(data + (i / 8)) ^= (1 << (7 - (i % 8)))
#endif