summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-02-05 03:37:04 +0000
committerFlorian Didron <fdidron@users.noreply.github.com>2020-02-26 10:15:12 +0900
commitcca46a85f3f67df6ae9539b42c8ad781d033b573 (patch)
tree8e4052f8b25d67da912e338a00add53afa532b62
parent6defb96175c48fed22c91354ad2894ade2fe0b1a (diff)
Reduce SPLIT_USB_TIMEOUT by 500ms (#7637)
* Update SPLIT_USB_TIMEOUT -500ms * Align keyboard level SPLIT_USB_TIMEOUT defaults * Align keyboard level SPLIT_USB_TIMEOUT_POLL * Review fixes
-rw-r--r--quantum/split_common/split_util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index da9e0a57dc..07d3bb36ad 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -15,14 +15,18 @@
#endif
#ifndef SPLIT_USB_TIMEOUT
-# define SPLIT_USB_TIMEOUT 2500
+# define SPLIT_USB_TIMEOUT 2000
+#endif
+
+#ifndef SPLIT_USB_TIMEOUT_POLL
+# define SPLIT_USB_TIMEOUT_POLL 10
#endif
volatile bool isLeftHand = true;
bool waitForUsb(void) {
- for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / 100); i++) {
- // This will return true of a USB connection has been established
+ for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
+ // This will return true if a USB connection has been established
#if defined(__AVR__)
if (UDADDR & _BV(ADDEN)) {
#else
@@ -30,7 +34,7 @@ bool waitForUsb(void) {
#endif
return true;
}
- wait_ms(100);
+ wait_ms(SPLIT_USB_TIMEOUT_POLL);
}
// Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow