summaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2023-08-26 19:52:12 -0700
committerGitHub <noreply@github.com>2023-08-27 03:52:12 +0100
commit25331be3164ca609ebecbfcc727ce904e3676594 (patch)
treecd82b1dc06085a977c1ccb9a6c6ba5752a037bc7 /platforms
parent736451558e3c66d10838625a30c904cfa30b170c (diff)
Revert changes to ChibiOS Suspend Code (#21830)
* Partially revert #19780 * Finish * Get teensy 3.5/3.6 board files too * fix lint issue * Revert "[Bug] Restore usb suspend wakeup delay (#21676)" This reverts commit e8e989fd7ad7c10e725e50ae8b0a4426e09f7f30. * Apply suggestions from code review Co-authored-by: Joel Challis <git@zvecr.com> --------- Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c4
-rw-r--r--platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c4
-rw-r--r--platforms/chibios/boards/IC_TEENSY_3_1/board/board.c5
-rw-r--r--platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk11
-rw-r--r--platforms/chibios/boards/PJRC_TEENSY_3_5/board/extra.c7
-rw-r--r--platforms/chibios/boards/PJRC_TEENSY_3_6/board/board.mk11
-rw-r--r--platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c7
-rw-r--r--platforms/chibios/suspend.c1
8 files changed, 49 insertions, 1 deletions
diff --git a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c
index e38a7e0054..f74c9e8be7 100644
--- a/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c
+++ b/platforms/chibios/boards/GENERIC_WB32_F3G71XX/board/board.c
@@ -80,3 +80,7 @@ void __early_init(void) {
void boardInit(void) {
}
+
+void restart_usb_driver(USBDriver *usbp) {
+ // Do nothing. Restarting the USB driver on these boards breaks it.
+}
diff --git a/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c b/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c
index 22b4ff73b5..a99537fc27 100644
--- a/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c
+++ b/platforms/chibios/boards/GENERIC_WB32_FQ95XX/board/board.c
@@ -80,3 +80,7 @@ void __early_init(void) {
void boardInit(void) {
}
+
+void restart_usb_driver(USBDriver *usbp) {
+ // Do nothing. Restarting the USB driver on these boards breaks it.
+}
diff --git a/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c b/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c
index 36ae8051ee..189d90952d 100644
--- a/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c
+++ b/platforms/chibios/boards/IC_TEENSY_3_1/board/board.c
@@ -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.
+}
diff --git a/platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk
new file mode 100644
index 0000000000..e129836b08
--- /dev/null
+++ b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/board.mk
@@ -0,0 +1,11 @@
+include $(CHIBIOS_CONTRIB)/os/hal/boards/PJRC_TEENSY_3_5/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_5/board/extra.c b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/extra.c
new file mode 100644
index 0000000000..4940d6d99b
--- /dev/null
+++ b/platforms/chibios/boards/PJRC_TEENSY_3_5/board/extra.c
@@ -0,0 +1,7 @@
+#include <hal.h>
+
+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.
+}
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 0000000000..aba195db04
--- /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 0000000000..4940d6d99b
--- /dev/null
+++ b/platforms/chibios/boards/PJRC_TEENSY_3_6/board/extra.c
@@ -0,0 +1,7 @@
+#include <hal.h>
+
+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.
+}
diff --git a/platforms/chibios/suspend.c b/platforms/chibios/suspend.c
index a937ccf059..ce03433e3a 100644
--- a/platforms/chibios/suspend.c
+++ b/platforms/chibios/suspend.c
@@ -42,7 +42,6 @@ void suspend_wakeup_init(void) {
clear_keys();
#ifdef MOUSEKEY_ENABLE
mousekey_clear();
- mousekey_send();
#endif /* MOUSEKEY_ENABLE */
#ifdef PROGRAMMABLE_BUTTON_ENABLE
programmable_button_clear();