Skip to content

Commit

Permalink
utils: bitops adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
zpl-zak committed Jan 11, 2024
1 parent 127c9b7 commit a8f7adf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/framework/src/utils/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// Define a flag at given position 'pos' in enum
#define BIT_FLD(pos) (1U << (pos))

// Set the bit at position 'pos' in 'var'
#define BIT_SET(var, pos) ((var) |= BIT_FLD(pos))
// Set the bit specified by 'val' in 'var'
#define BIT_SET(var, val) ((var) |= (val))

// Clear the bit at position 'pos' in 'var'
#define BIT_CLR(var, pos) ((var) &= ~BIT_FLD(pos))
// Clear the bit specified by 'val' in 'var'
#define BIT_CLR(var, val) ((var) &= ~(val))

// Check if the bit specified by 'val' in 'var' is set
#define BIT_HAS(var, val) ((var) & (val))
Expand Down

0 comments on commit a8f7adf

Please sign in to comment.