Skip to content

Fix 10 second blocking delay #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

bbx10
Copy link
Contributor

@bbx10 bbx10 commented Jan 8, 2016

usb.Task() has a 10 second blocking delay for all devices that doe IN transfers. This makes it hard to use USB host with other devices that need regular polling. For example, if data is streaming in to Serial1 at 115200 bits/s, the incoming data will not be processed for up to 10 seconds.

This can be seen by adding timing output to the keyboard example. The following prints "delta millis 10000" when there is no keyboard input.

void loop() {
  uint32_t delta, startMillis = millis();

  // Process USB tasks
  usb.Task();

  delta = millis() - startMillis;
  if (delta > 10) {
    Serial.print("delta millis ");
    Serial.println(delta);
  }
}

Affects all devices that do IN transfers.
@ladyada
Copy link
Contributor

ladyada commented Feb 15, 2016

just tested this...made keyboardcontroller waaay more responsive. thx!

ladyada added a commit to adafruit/ArduinoCore-samd that referenced this pull request Feb 15, 2016
@cmaglie
Copy link
Member

cmaglie commented Feb 18, 2016

Rebased and merged. Thank you!

@cmaglie cmaglie closed this Feb 18, 2016
@cmaglie cmaglie added this to the Release 1.6.4 milestone Feb 18, 2016
deanm1278 pushed a commit to adafruit/ArduinoCore-samd that referenced this pull request Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants