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/chibios | |
| 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/chibios')
| -rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index d04302aca..407b8ea75 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c | |||
| @@ -903,7 +903,8 @@ static void send_extra(uint8_t report_id, uint16_t data) { | |||
| 903 | return; | 903 | return; |
| 904 | } | 904 | } |
| 905 | 905 | ||
| 906 | report_extra_t report = {.report_id = report_id, .usage = data}; | 906 | static report_extra_t report; |
| 907 | report = (report_extra_t){.report_id = report_id, .usage = data}; | ||
| 907 | 908 | ||
| 908 | usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); | 909 | usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); |
| 909 | osalSysUnlock(); | 910 | osalSysUnlock(); |
| @@ -1051,45 +1052,44 @@ void virtser_task(void) { | |||
| 1051 | #ifdef JOYSTICK_ENABLE | 1052 | #ifdef JOYSTICK_ENABLE |
| 1052 | 1053 | ||
| 1053 | void send_joystick_packet(joystick_t *joystick) { | 1054 | void send_joystick_packet(joystick_t *joystick) { |
| 1054 | joystick_report_t rep = { | 1055 | static joystick_report_t rep; |
| 1056 | rep = (joystick_report_t) { | ||
| 1055 | # if JOYSTICK_AXES_COUNT > 0 | 1057 | # if JOYSTICK_AXES_COUNT > 0 |
| 1056 | .axes = | 1058 | .axes = |
| 1057 | { | 1059 | { joystick->axes[0], |
| 1058 | joystick->axes[0], | ||
| 1059 | 1060 | ||
| 1060 | # if JOYSTICK_AXES_COUNT >= 2 | 1061 | # if JOYSTICK_AXES_COUNT >= 2 |
| 1061 | joystick->axes[1], | 1062 | joystick->axes[1], |
| 1062 | # endif | 1063 | # endif |
| 1063 | # if JOYSTICK_AXES_COUNT >= 3 | 1064 | # if JOYSTICK_AXES_COUNT >= 3 |
| 1064 | joystick->axes[2], | 1065 | joystick->axes[2], |
| 1065 | # endif | 1066 | # endif |
| 1066 | # if JOYSTICK_AXES_COUNT >= 4 | 1067 | # if JOYSTICK_AXES_COUNT >= 4 |
| 1067 | joystick->axes[3], | 1068 | joystick->axes[3], |
| 1068 | # endif | 1069 | # endif |
| 1069 | # if JOYSTICK_AXES_COUNT >= 5 | 1070 | # if JOYSTICK_AXES_COUNT >= 5 |
| 1070 | joystick->axes[4], | 1071 | joystick->axes[4], |
| 1071 | # endif | 1072 | # endif |
| 1072 | # if JOYSTICK_AXES_COUNT >= 6 | 1073 | # if JOYSTICK_AXES_COUNT >= 6 |
| 1073 | joystick->axes[5], | 1074 | joystick->axes[5], |
| 1074 | # endif | 1075 | # endif |
| 1075 | }, | 1076 | }, |
| 1076 | # endif // JOYSTICK_AXES_COUNT>0 | 1077 | # endif // JOYSTICK_AXES_COUNT>0 |
| 1077 | 1078 | ||
| 1078 | # if JOYSTICK_BUTTON_COUNT > 0 | 1079 | # if JOYSTICK_BUTTON_COUNT > 0 |
| 1079 | .buttons = | 1080 | .buttons = { |
| 1080 | { | 1081 | joystick->buttons[0], |
| 1081 | joystick->buttons[0], | ||
| 1082 | 1082 | ||
| 1083 | # if JOYSTICK_BUTTON_COUNT > 8 | 1083 | # if JOYSTICK_BUTTON_COUNT > 8 |
| 1084 | joystick->buttons[1], | 1084 | joystick->buttons[1], |
| 1085 | # endif | 1085 | # endif |
| 1086 | # if JOYSTICK_BUTTON_COUNT > 16 | 1086 | # if JOYSTICK_BUTTON_COUNT > 16 |
| 1087 | joystick->buttons[2], | 1087 | joystick->buttons[2], |
| 1088 | # endif | 1088 | # endif |
| 1089 | # if JOYSTICK_BUTTON_COUNT > 24 | 1089 | # if JOYSTICK_BUTTON_COUNT > 24 |
| 1090 | joystick->buttons[3], | 1090 | joystick->buttons[3], |
| 1091 | # endif | 1091 | # endif |
| 1092 | } | 1092 | } |
| 1093 | # endif // JOYSTICK_BUTTON_COUNT>0 | 1093 | # endif // JOYSTICK_BUTTON_COUNT>0 |
| 1094 | }; | 1094 | }; |
| 1095 | 1095 | ||
