From cc658bc63465b00f1cd6c0a841606433ea56e30a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 20 Nov 2022 13:44:34 +0100 Subject: [PATCH] kint36: do not restart USB stack after wakeup Without this change, the Teensy 3.6 kinT variant can wake a computer from Suspend-to-RAM, but the keyboard does not actually produce any keypresses until you un-plug and re-plug it. related to https://github.com/kinx-project/kint/issues/59 related to https://github.com/qmk/qmk_firmware/issues/16934 --- .../chibios/boards/PJRC_TEENSY_3_6/board/board.mk | 11 +++++++++++ .../chibios/boards/PJRC_TEENSY_3_6/board/extra.c | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk create mode 100644 platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk new file mode 100644 index 000000000000..aba195db042a --- /dev/null +++ b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk @@ -0,0 +1,11 @@ +include $(CHIBIOS_CONTRIB)/os/hal/boards/PJRC_TEENSY_3_6/board.mk + +# List of all the board related files. +BOARDSRC += $(BOARD_PATH)/board/extra.c + +# Required include directories +BOARDINC += $(BOARD_PATH)/board + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c new file mode 100644 index 000000000000..4940d6d99b5b --- /dev/null +++ b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c @@ -0,0 +1,7 @@ +#include + +void restart_usb_driver(USBDriver *usbp) { + // Do nothing. Restarting the USB driver on the Teensy 3.6 breaks it, + // resulting in a keyboard which can wake up a PC from Suspend-to-RAM, but + // does not actually produce any keypresses until you un-plug and re-plug. +}