1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 17:25:18 +03:00

Add a proper type for bit arrays

- Define type bitArrayElement_t as uint32_t.
- Add BITARRAY_DECLARE() macro, which declares a bit array given
the number of desired bits, taking care of aligment and rounding
up its size to a multiple of 32.
- Change bit array functions to accept bitarrayElement_t* rather
than void*.
- Replace bit array declarations with BITARRAY_DECLARE() macro
- Add BITARRAY_FIND_FIRST_SET() macro to call bitArrayFindFirstSet()
without explicitely specifying its size.
- Update comments in bitarray.h to reflect these changes.
This commit is contained in:
Alberto García Hierro 2017-09-15 09:53:53 +01:00
parent daa4c17c3b
commit 9fd3b4286f
6 changed files with 28 additions and 20 deletions

View file

@ -417,7 +417,7 @@ static void packBoxModeFlags(boxBitmask_t * mspBoxModeFlags)
memset(mspBoxModeFlags, 0, sizeof(boxBitmask_t));
for (uint32_t i = 0; i < activeBoxIdCount; i++) {
if (activeBoxes[activeBoxIds[i]]) {
bitArraySet(mspBoxModeFlags, i);
bitArraySet(mspBoxModeFlags->bits, i);
}
}
}