aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol
diff options
context:
space:
mode:
authorJoel Challis <[email protected]>2024-04-24 19:33:52 +0100
committerGitHub <[email protected]>2024-04-24 19:33:52 +0100
commit16cca527a6b46c2aa365428d7d1e214509068c4a (patch)
tree4111bbd48f67ab300652836c1a9d860eaac734ff /tmk_core/protocol
parentc8ceda461afb9d6aab33309a06c94fceabfcbc72 (diff)
downloadqmk_firmware-16cca527a6b46c2aa365428d7d1e214509068c4a.tar.gz
qmk_firmware-16cca527a6b46c2aa365428d7d1e214509068c4a.zip
Fix WAIT_FOR_USB handling (#23598)
Diffstat (limited to 'tmk_core/protocol')
-rw-r--r--tmk_core/protocol/chibios/chibios.c7
-rw-r--r--tmk_core/protocol/lufa/lufa.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c
index a02097785f..a249af8d38 100644
--- a/tmk_core/protocol/chibios/chibios.c
+++ b/tmk_core/protocol/chibios/chibios.c
@@ -51,6 +51,11 @@
#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED (2U)
+#ifdef WAIT_FOR_USB
+// TODO: Remove backwards compatibility with old define
+# define USB_WAIT_FOR_ENUMERATION
+#endif
+
/* -------------------------
* TMK host driver defs
* -------------------------
@@ -143,7 +148,7 @@ void protocol_pre_init(void) {
/* Wait until USB is active */
while (true) {
-#if defined(WAIT_FOR_USB)
+#if defined(USB_WAIT_FOR_ENUMERATION)
if (USB_DRIVER.state == USB_ACTIVE) {
driver = &chibios_driver;
break;
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index d6f0c69b6b..2142b04460 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -67,6 +67,11 @@
# include "raw_hid.h"
#endif
+#ifdef WAIT_FOR_USB
+// TODO: Remove backwards compatibility with old define
+# define USB_WAIT_FOR_ENUMERATION
+#endif
+
uint8_t keyboard_idle = 0;
/* 0: Boot Protocol, 1: Report Protocol(default) */
uint8_t keyboard_protocol = 1;
@@ -807,7 +812,7 @@ void protocol_pre_init(void) {
/* wait for USB startup & debug output */
-#ifdef WAIT_FOR_USB
+#ifdef USB_WAIT_FOR_ENUMERATION
while (USB_DeviceState != DEVICE_STATE_Configured) {
# if defined(INTERRUPT_CONTROL_ENDPOINT)
;