diff options
Diffstat (limited to 'src/bitfield/bitfield.c')
-rw-r--r-- | src/bitfield/bitfield.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bitfield/bitfield.c b/src/bitfield/bitfield.c index af17d485..ae1be403 100644 --- a/src/bitfield/bitfield.c +++ b/src/bitfield/bitfield.c @@ -21,3 +21,9 @@ uint8_t get_byte(const uint8_t source[], const uint8_t source_length, } return 0; } + +bool set_nibble(const uint16_t nibble_index, const uint8_t value, + uint8_t* destination, const uint16_t destination_length) { + return copy_bits(&value, CHAR_BIT, NIBBLE_SIZE, NIBBLE_SIZE, destination, + destination_length, nibble_index * NIBBLE_SIZE); +} |