Skip to content

Commit

Permalink
Allow larger SPLIT_USB_TIMEOUT with default SPLIT_USB_TIMEOUT_POLL (#…
Browse files Browse the repository at this point in the history
…17272)

* Switch SPLIT_USB_DETECT loop to uint16_t

* Add assertion
  • Loading branch information
daskygit authored May 31, 2022
1 parent f9e97fd commit af02baa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quantum/split_common/split_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ static uint8_t connection_errors = 0;
volatile bool isLeftHand = true;

#if defined(SPLIT_USB_DETECT)
_Static_assert((SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL) <= UINT16_MAX, "Please lower SPLIT_USB_TIMEOUT and/or increase SPLIT_USB_TIMEOUT_POLL.");
static bool usbIsActive(void) {
for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
for (uint16_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
// This will return true if a USB connection has been established
if (usb_connected_state()) {
return true;
Expand Down

0 comments on commit af02baa

Please sign in to comment.