mirror of
https://github.com/stargieg/bacnet-stack
synced 2025-10-26 23:35:52 +08:00
19 lines
486 B
C
19 lines
486 B
C
#ifndef AVR035_H
|
|
#define AVR035_H
|
|
|
|
/* from AVR035: Efficient C Coding for AVR */
|
|
|
|
/* a=register, b=bit number to act upon */
|
|
#define BIT_SET(a,b) ((a) |= (1<<(b)))
|
|
#define BIT_CLEAR(a,b) ((a) &= ~(1<<(b)))
|
|
#define BIT_FLIP(a,b) ((a) ^= (1<<(b)))
|
|
#define BIT_CHECK(a,b) ((a) & (1<<(b)))
|
|
|
|
/* x=target variable, y=mask */
|
|
#define BITMASK_SET(x,y) ((x) |= (y))
|
|
#define BITMASK_CLEAR(x,y) ((x) &= (~(y)))
|
|
#define BITMASK_FLIP(x,y) ((x) ^= (y))
|
|
#define BITMASK_CHECK(x,y) ((x) & (y))
|
|
|
|
#endif
|