util: add util_set_bit

Sets a single bit in a uint8_t * bit field
This commit is contained in:
James Prestwood 2019-08-21 15:21:43 -07:00 committed by Denis Kenzior
parent dd2daa4961
commit 76b73a1cf5
1 changed files with 5 additions and 0 deletions

View File

@ -65,4 +65,9 @@ static inline bool util_mem_is_zero(const uint8_t *field, size_t size)
return true;
}
static inline void util_set_bit(uint8_t *field, unsigned int bit)
{
field[bit / 8] = 1 << (bit % 8);
}
#endif /* __UTIL_H */