summaryrefslogtreecommitdiff
path: root/src/host/hub.h
diff options
context:
space:
mode:
authorJeremiah McCarthy <[email protected]>2021-02-16 10:40:06 -0500
committerJeremiah McCarthy <[email protected]>2021-02-16 10:43:52 -0500
commitf8fbc0930bd17b263ca702c0beb9f83af4429d0a (patch)
treeb47b6a6f41cd8115d4a7d6acf2af4e2872f7a86c /src/host/hub.h
parent09868434cd9f53394350cce682333ada97f796c3 (diff)
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.
Diffstat (limited to 'src/host/hub.h')
-rw-r--r--src/host/hub.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/host/hub.h b/src/host/hub.h
index 35d8ad629..0e3292274 100644
--- a/src/host/hub.h
+++ b/src/host/hub.h
@@ -1,4 +1,4 @@
-/*
+/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
@@ -163,7 +163,11 @@ typedef struct {
uint16_t high_speed : 1;
uint16_t port_test_mode : 1;
uint16_t port_indicator_control : 1;
- uint16_t : 0;
+#if CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT
+ uint16_t unused : 3;
+#else
+ uint16_t : 0;
+#endif /* CFG_TUSB_ALT_BIT_PACKING_ALIGNMENT */
};
uint16_t value;