Skip to content

Conversation

@dewhisna
Copy link

This fix changes the delay time calculations in USBHost::Task() to use a delta time rather than the absolute time from millis(), changing the definition of the 'delay' variable to be the number of milliseconds remaining rather than an absolute time "on the clock".

This resolves two issues:

  1. Calculation issues when the millis() clock rolls over to 0, which previously caused the comparison between delay and millis() to yield incorrect results.
  2. Long USB I/O delays caused when Task() isn't called sufficiently often enough.

This change is in conjunction with the discussion for issue #2.

bbx10 and others added 2 commits February 13, 2016 10:10
0x00 CTRL-@ through 0x1F CTRL-_

Also return ASCII codes for keys: ESCAPE, DELETE, TAB, and BACKSPACE keys.
Return correct code for ENTER and keypad ENTER keys.
… the absolute time from millis().

Changed the definition of "delay" to be the remaining milliseconds to delay rather than the absolute time of the end of the delay.
This fixes timer wrapping issues caused when millis() wraps back to 0.
And it allows the Task() function to not have be continually called as often when higher priority tasks need to supercede it, and prevents restart delays after an extended period of missed calls to Task().
@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ dewhisna
❌ bbx10
You have signed the CLA already but the status is still pending? Let us recheck it.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants