aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/helix
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-02-05 03:37:04 +0000
committerGitHub <noreply@github.com>2020-02-04 19:37:04 -0800
commit307be48de9a24a182420a6c42222906132035ea2 (patch)
tree269de1fe60e4f36b5ba1d266060308dc49209df3 /keyboards/helix
parenta557a5b2c5e62c20e037fbca56dc902a20cd6ff8 (diff)
downloadfirmware-307be48de9a24a182420a6c42222906132035ea2.tar.gz
firmware-307be48de9a24a182420a6c42222906132035ea2.tar.bz2
firmware-307be48de9a24a182420a6c42222906132035ea2.zip
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
Diffstat (limited to 'keyboards/helix')
-rw-r--r--keyboards/helix/rev2/split_util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c
index 89df43e27..9d31d0dec 100644
--- a/keyboards/helix/rev2/split_util.c
+++ b/keyboards/helix/rev2/split_util.c
@@ -20,18 +20,22 @@
#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 (UDADDR & _BV(ADDEN)) {
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