summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios
diff options
context:
space:
mode:
authorGeorge Harris <ashandore@gmail.com>2020-01-25 22:35:39 +0100
committerFlorian Didron <fdidron@users.noreply.github.com>2020-02-26 10:15:12 +0900
commitb1e8a80477403bb00bdb44a155d831f25cf7fb7b (patch)
treed768fb152dc13b7478c76d3725a7c0cb1f76dc9b /tmk_core/protocol/chibios
parent7645e9795bb35aa5b365e06cd8e751d5e1fce378 (diff)
Fix unaligned access with LTO (#7801)
Forces 4 byte alignment for USB input & output buffers to prevent unaligned accesses by chibios with LTO enabled
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r--tmk_core/protocol/chibios/usb_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 966524c9dd..5a10ef69f2 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -246,8 +246,8 @@ typedef struct {
.in_size = stream##_EPSIZE, \
.out_size = stream##_EPSIZE, \
.fixed_size = fixedsize, \
- .ib = (uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]){}, \
- .ob = (uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY, stream##_EPSIZE)]){}, \
+ .ib = (__attribute__((aligned(4))) uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]){}, \
+ .ob = (__attribute__((aligned(4))) uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY, stream##_EPSIZE)]){}, \
} \
}