~ruther/qmk_firmware

1409b368517a8ce9af1320acc75f7a8fbcdfca18 — Joakim Tufvegren 4 years ago 34de7ca
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.
M keyboards/ergodox_infinity/rules.mk => keyboards/ergodox_infinity/rules.mk +7 -0
@@ 4,6 4,13 @@ MCU = MK20DX256
# Bootloader selection
BOOTLOADER = kiibohd

# Board: it should exist either in <chibios>/os/hal/boards/
#  or <this_dir>/boards
# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
# hack to ensure the watchdog has started before trying to disable it, and an
# override to disable restart of USB driver after returning from suspend.
BOARD = IC_TEENSY_3_1

# Build Options
#   comment out to disable the options.
#

M keyboards/k_type/rules.mk => keyboards/k_type/rules.mk +2 -1
@@ 7,7 7,8 @@ BOOTLOADER = kiibohd
# Board: it should exist either in <chibios>/os/hal/boards/
#  or <this_dir>/boards
# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
# hack to ensure the watchdog has started before trying to disable it.
# hack to ensure the watchdog has started before trying to disable it, and an
# override to disable restart of USB driver after returning from suspend.
BOARD = IC_TEENSY_3_1

# Build Options

M keyboards/whitefox/rules.mk => keyboards/whitefox/rules.mk +3 -5
@@ 6,11 6,9 @@ BOOTLOADER = kiibohd

# Board: it should exist either in <chibios>/os/hal/boards/
#  or <this_dir>/boards
# - BOARD =
#   - PJRC_TEENSY_LC for Teensy LC
#   - PJRC_TEENSY_3 for Teensy 3.0
#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
#   - MCHCK_K20 for Infinity KB
# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
# hack to ensure the watchdog has started before trying to disable it, and an
# override to disable restart of USB driver after returning from suspend.
BOARD = IC_TEENSY_3_1

# Build Options

M platforms/chibios/IC_TEENSY_3_1/board/board.c => platforms/chibios/IC_TEENSY_3_1/board/board.c +5 -0
@@ 144,3 144,8 @@ void __early_init(void) {
 * @todo    Add your board-specific code, if any.
 */
void boardInit(void) {}


void restart_usb_driver(USBDriver *usbp) {
    // Do nothing. Restarting the USB driver on these boards breaks it.
}

M tmk_core/protocol/chibios/usb_main.c => tmk_core/protocol/chibios/usb_main.c +1 -1
@@ 705,7 705,7 @@ void init_usb_driver(USBDriver *usbp) {
    chVTObjectInit(&keyboard_idle_timer);
}

void restart_usb_driver(USBDriver *usbp) {
__attribute__((weak)) void restart_usb_driver(USBDriver *usbp) {
    usbStop(usbp);
    usbDisconnectBus(usbp);