aboutsummaryrefslogtreecommitdiff
path: root/quantum
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 /quantum
parenta557a5b2c5e62c20e037fbca56dc902a20cd6ff8 (diff)
downloadqmk_firmware-307be48de9a24a182420a6c42222906132035ea2.tar.gz
qmk_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 'quantum')
-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 076f18664..103bc9714 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -15,14 +15,18 @@
15#endif 15#endif
16 16
17#ifndef SPLIT_USB_TIMEOUT 17#ifndef SPLIT_USB_TIMEOUT
18# define SPLIT_USB_TIMEOUT 2500 18# define SPLIT_USB_TIMEOUT 2000
19#endif
20
21#ifndef SPLIT_USB_TIMEOUT_POLL
22# define SPLIT_USB_TIMEOUT_POLL 10
19#endif 23#endif
20 24
21volatile bool isLeftHand = true; 25volatile bool isLeftHand = true;
22 26
23bool waitForUsb(void) { 27bool waitForUsb(void) {
24 for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / 100); i++) { 28 for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
25 // This will return true of a USB connection has been established 29 // This will return true if a USB connection has been established
26#if defined(__AVR__) 30#if defined(__AVR__)
27 if (UDADDR & _BV(ADDEN)) { 31 if (UDADDR & _BV(ADDEN)) {
28#else 32#else
@@ -30,7 +34,7 @@ bool waitForUsb(void) {
30#endif 34#endif
31 return true; 35 return true;
32 } 36 }
33 wait_ms(100); 37 wait_ms(SPLIT_USB_TIMEOUT_POLL);
34 } 38 }
35 39
36 // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow 40 // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow