10#define MSB(_x) ((_x) >> 8)
12#define LSB(_x) ((_x)&0xFF)
15#define WAIT_FOR(_cond) \
22#define INFINITE_LOOP() while (true)
25#define BETWEEN(_x, _l, _h) ((_l) < (_x) && (_x) < (_h))
28#define IN_RANGE(_x, _l, _h) ((_l) <= (_x) && (_x) <= (_h))
31#define RANGES_OVERLAP(_start1, _end1, _start2, _end2) \
32 ((_start1) <= (_end2) && (_end1) >= (_start2))
35#define UNUSED(_x) (void)(_x);
38#define ARRAY_SIZE(_arr) (sizeof(_arr) / sizeof(_arr[0]))
41#define RETURN_CMP(_x, _y) \
43 typeof((_x)) _tmp_x = (_x); \
44 typeof((_y)) _tmp_y = (_y); \
45 if (_tmp_x == _tmp_y) \
47 return (_tmp_x < _tmp_y) ? -1 : 1; \
50#define CONCAT(_x, _y) _x##_y
51#define CONCAT3(_x, _y, _z) _x##_y##_z
57 typeof((_x)) _tmp = _x; \