forked from mirrors/qmk_userspace
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
This commit is contained in:
parent
a557a5b2c5
commit
307be48de9
5 changed files with 34 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue