~ruther/qmk_firmware

e9ffc5347690ad2212d7217e406fb6018ed17079 — George Harris 5 years ago 480a391
Fix unaligned access with LTO (#7801)

Forces 4 byte alignment for USB input & output buffers to prevent unaligned accesses by chibios with LTO enabled 
1 files changed, 2 insertions(+), 2 deletions(-)

M tmk_core/protocol/chibios/usb_main.c
M tmk_core/protocol/chibios/usb_main.c => tmk_core/protocol/chibios/usb_main.c +2 -2
@@ 227,8 227,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)]){}, \
        }                                                                                       \
    }