Add alternate bitfield padding option

Adds configuration option CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT, which
substitutes bitfield variable " : 0" padding syntax with an unused
variable of size equal to the remaining number of bits.

This change resolves aligned access issues for some platforms.

Default behavior is original if the option is not explicitly enabled.
This commit is contained in:
Jeremiah McCarthy
2021-02-16 10:40:06 -05:00
parent 09868434cd
commit f8fbc0930b
6 changed files with 56 additions and 9 deletions

View File

@@ -197,6 +197,10 @@
#define CFG_TUSB_OS OPT_OS_NONE
#endif
#ifndef CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT
#define CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT 0
#endif
//--------------------------------------------------------------------
// DEVICE OPTIONS
//--------------------------------------------------------------------