diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2021-06-07 07:16:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-06 22:16:55 -0700 |
commit | 49fd3c0760e06b7eab3647098530f1a9bdfc5054 (patch) | |
tree | fe39ef15dacb63d32f2a881af7fac364f02b32db /tmk_core/protocol/lufa/lufa.c | |
parent | 415dd21206922fc69929d8ef5d7ab7f13e9c2fbc (diff) | |
download | qmk_firmware-49fd3c0760e06b7eab3647098530f1a9bdfc5054.tar.gz qmk_firmware-49fd3c0760e06b7eab3647098530f1a9bdfc5054.zip |
[Core] ChibiOS fix O3 and LTO breakage of extra keys and joystick (#12819)
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
-rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 63619fdb3..4ac079e16 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
@@ -314,45 +314,44 @@ static void Console_Task(void) { | |||
314 | void send_joystick_packet(joystick_t *joystick) { | 314 | void send_joystick_packet(joystick_t *joystick) { |
315 | uint8_t timeout = 255; | 315 | uint8_t timeout = 255; |
316 | 316 | ||
317 | joystick_report_t r = { | 317 | static joystick_report_t; |
318 | r = (joystick_report_t) { | ||
318 | # if JOYSTICK_AXES_COUNT > 0 | 319 | # if JOYSTICK_AXES_COUNT > 0 |
319 | .axes = | 320 | .axes = |
320 | { | 321 | { joystick->axes[0], |
321 | joystick->axes[0], | ||
322 | 322 | ||
323 | # if JOYSTICK_AXES_COUNT >= 2 | 323 | # if JOYSTICK_AXES_COUNT >= 2 |
324 | joystick->axes[1], | 324 | joystick->axes[1], |
325 | # endif | 325 | # endif |
326 | # if JOYSTICK_AXES_COUNT >= 3 | 326 | # if JOYSTICK_AXES_COUNT >= 3 |
327 | joystick->axes[2], | 327 | joystick->axes[2], |
328 | # endif | 328 | # endif |
329 | # if JOYSTICK_AXES_COUNT >= 4 | 329 | # if JOYSTICK_AXES_COUNT >= 4 |
330 | joystick->axes[3], | 330 | joystick->axes[3], |
331 | # endif | 331 | # endif |
332 | # if JOYSTICK_AXES_COUNT >= 5 | 332 | # if JOYSTICK_AXES_COUNT >= 5 |
333 | joystick->axes[4], | 333 | joystick->axes[4], |
334 | # endif | 334 | # endif |
335 | # if JOYSTICK_AXES_COUNT >= 6 | 335 | # if JOYSTICK_AXES_COUNT >= 6 |
336 | joystick->axes[5], | 336 | joystick->axes[5], |
337 | # endif | 337 | # endif |
338 | }, | 338 | }, |
339 | # endif // JOYSTICK_AXES_COUNT>0 | 339 | # endif // JOYSTICK_AXES_COUNT>0 |
340 | 340 | ||
341 | # if JOYSTICK_BUTTON_COUNT > 0 | 341 | # if JOYSTICK_BUTTON_COUNT > 0 |
342 | .buttons = | 342 | .buttons = { |
343 | { | 343 | joystick->buttons[0], |
344 | joystick->buttons[0], | ||
345 | 344 | ||
346 | # if JOYSTICK_BUTTON_COUNT > 8 | 345 | # if JOYSTICK_BUTTON_COUNT > 8 |
347 | joystick->buttons[1], | 346 | joystick->buttons[1], |
348 | # endif | 347 | # endif |
349 | # if JOYSTICK_BUTTON_COUNT > 16 | 348 | # if JOYSTICK_BUTTON_COUNT > 16 |
350 | joystick->buttons[2], | 349 | joystick->buttons[2], |
351 | # endif | 350 | # endif |
352 | # if JOYSTICK_BUTTON_COUNT > 24 | 351 | # if JOYSTICK_BUTTON_COUNT > 24 |
353 | joystick->buttons[3], | 352 | joystick->buttons[3], |
354 | # endif | 353 | # endif |
355 | } | 354 | } |
356 | # endif // JOYSTICK_BUTTON_COUNT>0 | 355 | # endif // JOYSTICK_BUTTON_COUNT>0 |
357 | }; | 356 | }; |
358 | 357 | ||
@@ -768,7 +767,8 @@ static void send_extra(uint8_t report_id, uint16_t data) { | |||
768 | 767 | ||
769 | if (USB_DeviceState != DEVICE_STATE_Configured) return; | 768 | if (USB_DeviceState != DEVICE_STATE_Configured) return; |
770 | 769 | ||
771 | report_extra_t r = {.report_id = report_id, .usage = data}; | 770 | static report_extra_t r; |
771 | r = (report_extra_t){.report_id = report_id, .usage = data}; | ||
772 | Endpoint_SelectEndpoint(SHARED_IN_EPNUM); | 772 | Endpoint_SelectEndpoint(SHARED_IN_EPNUM); |
773 | 773 | ||
774 | /* Check if write ready for a polling interval around 10ms */ | 774 | /* Check if write ready for a polling interval around 10ms */ |