aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/util.h')
-rw-r--r--libmaple/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmaple/util.h b/libmaple/util.h
index 080f1bf..7b41769 100644
--- a/libmaple/util.h
+++ b/libmaple/util.h
@@ -42,10 +42,13 @@ extern "C"{
* Bit manipulation
*/
+/** 1 << the bit number */
#define BIT(shift) (1UL << (shift))
+/** Mask shifted left by 'shift' */
#define BIT_MASK_SHIFT(mask, shift) ((mask) << (shift))
/** Bits m to n of x */
#define GET_BITS(x, m, n) ((((uint32)x) << (31 - (n))) >> ((31 - (n)) + (m)))
+/** True if v is a power of two (1, 2, 4, 8, ...) */
#define IS_POWER_OF_TWO(v) ((v) && !((v) & ((v) - 1)))
/*