Fixed setting bit-field members in random order

This commit is contained in:
Raphael Coeffic
2021-12-31 10:53:11 +01:00
parent e56e769d27
commit 1a7e5e3b2b
+1 -1
View File
@@ -32,7 +32,7 @@ void yaml_put_bits(uint8_t* dst, uint32_t i, uint32_t bit_ofs, uint32_t bits)
if (bit_ofs) {
*dst &= MASK_LOWER(bit_ofs);
*dst &= ~((MASK_LOWER(bits) << bit_ofs) & 0xFF);
*(dst++) |= (i << bit_ofs) & 0xFF;
if (bits <= 8 - bit_ofs)