aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tufvegren <jocke@barbanet.com>2021-08-03 23:38:37 +0200
committerGitHub <noreply@github.com>2021-08-04 07:38:37 +1000
commit1409b368517a8ce9af1320acc75f7a8fbcdfca18 (patch)
treed60cb7ecaedc9e61367d4ad357a111747d8256f4
parent34de7ca224d613e1ae19a45860e27c15d40254dd (diff)
downloadqmk_firmware-1409b368517a8ce9af1320acc75f7a8fbcdfca18.tar.gz
qmk_firmware-1409b368517a8ce9af1320acc75f7a8fbcdfca18.zip
Remove the #10088 hotfix for Teensy 3.1-like Input:Club keyboards (#12870)
* Remove the #10088 hotfix for K20x MCU:s. It seems to _cause_ the issue it intended to solve there. * Cleaner way of removing #10088 hotfix. Now only affects Ergodox Infinity, Whitefox and K-type, though. Switches over Ergodox Infinity to the `IC_TEENSY_3_1` board, since that was a nice place to implement the `restart_usb_driver` override. However, I would guess this issue is present for other K20x/Teensy 3.1 boards as well... * Fix comment regarding `IC_TEENSY_3_1` for all keyboards using it.
-rw-r--r--keyboards/ergodox_infinity/rules.mk7
-rw-r--r--keyboards/k_type/rules.mk3
-rw-r--r--keyboards/whitefox/rules.mk8
-rw-r--r--platforms/chibios/IC_TEENSY_3_1/board/board.c5
-rw-r--r--tmk_core/protocol/chibios/usb_main.c2
5 files changed, 18 insertions, 7 deletions
diff --git a/keyboards/ergodox_infinity/rules.mk b/keyboards/ergodox_infinity/rules.mk
index fbd52cd25..6c490ca0d 100644
--- a/keyboards/ergodox_infinity/rules.mk
+++ b/keyboards/ergodox_infinity/rules.mk
@@ -4,6 +4,13 @@ MCU = MK20DX256
4# Bootloader selection 4# Bootloader selection
5BOOTLOADER = kiibohd 5BOOTLOADER = kiibohd
6 6
7# Board: it should exist either in <chibios>/os/hal/boards/
8# or <this_dir>/boards
9# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
10# hack to ensure the watchdog has started before trying to disable it, and an
11# override to disable restart of USB driver after returning from suspend.
12BOARD = IC_TEENSY_3_1
13
7# Build Options 14# Build Options
8# comment out to disable the options. 15# comment out to disable the options.
9# 16#
diff --git a/keyboards/k_type/rules.mk b/keyboards/k_type/rules.mk
index 369cab4f0..ffd350ef8 100644
--- a/keyboards/k_type/rules.mk
+++ b/keyboards/k_type/rules.mk
@@ -7,7 +7,8 @@ BOOTLOADER = kiibohd
7# Board: it should exist either in <chibios>/os/hal/boards/ 7# Board: it should exist either in <chibios>/os/hal/boards/
8# or <this_dir>/boards 8# or <this_dir>/boards
9# This board was copied from PJRC_TEENSY_3_1. The only difference should be a 9# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
10# hack to ensure the watchdog has started before trying to disable it. 10# hack to ensure the watchdog has started before trying to disable it, and an
11# override to disable restart of USB driver after returning from suspend.
11BOARD = IC_TEENSY_3_1 12BOARD = IC_TEENSY_3_1
12 13
13# Build Options 14# Build Options
diff --git a/keyboards/whitefox/rules.mk b/keyboards/whitefox/rules.mk
index 7c1d0c3de..cc02f3472 100644
--- a/keyboards/whitefox/rules.mk
+++ b/keyboards/whitefox/rules.mk
@@ -6,11 +6,9 @@ BOOTLOADER = kiibohd
6 6
7# Board: it should exist either in <chibios>/os/hal/boards/ 7# Board: it should exist either in <chibios>/os/hal/boards/
8# or <this_dir>/boards 8# or <this_dir>/boards
9# - BOARD = 9# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
10# - PJRC_TEENSY_LC for Teensy LC 10# hack to ensure the watchdog has started before trying to disable it, and an
11# - PJRC_TEENSY_3 for Teensy 3.0 11# override to disable restart of USB driver after returning from suspend.
12# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
13# - MCHCK_K20 for Infinity KB
14BOARD = IC_TEENSY_3_1 12BOARD = IC_TEENSY_3_1
15 13
16# Build Options 14# Build Options
diff --git a/platforms/chibios/IC_TEENSY_3_1/board/board.c b/platforms/chibios/IC_TEENSY_3_1/board/board.c
index 36ae8051e..424e0c975 100644
--- a/platforms/chibios/IC_TEENSY_3_1/board/board.c
+++ b/platforms/chibios/IC_TEENSY_3_1/board/board.c
@@ -144,3 +144,8 @@ void __early_init(void) {
144 * @todo Add your board-specific code, if any. 144 * @todo Add your board-specific code, if any.
145 */ 145 */
146void boardInit(void) {} 146void boardInit(void) {}
147
148
149void restart_usb_driver(USBDriver *usbp) {
150 // Do nothing. Restarting the USB driver on these boards breaks it.
151}
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 3adbb9799..441cfab97 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -705,7 +705,7 @@ void init_usb_driver(USBDriver *usbp) {
705 chVTObjectInit(&keyboard_idle_timer); 705 chVTObjectInit(&keyboard_idle_timer);
706} 706}
707 707
708void restart_usb_driver(USBDriver *usbp) { 708__attribute__((weak)) void restart_usb_driver(USBDriver *usbp) {
709 usbStop(usbp); 709 usbStop(usbp);
710 usbDisconnectBus(usbp); 710 usbDisconnectBus(usbp);
711 711