-
Notifications
You must be signed in to change notification settings - Fork 20
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
Tick Timer Wrap #328
Comments
Test case:
Output:
|
I agree, there is a latent bug here. After 49 days of uptime, if SDIO access occurs during the wrapover, it will return an error which will be reported to SCSI host. In a quick review, other timeouts in the codebase are using the correct form |
Fix has been merged into main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is sort of a code review comment, not something I have actually encountered, let alone recreated, but I think there is a latent defect in SdioCard::stopTransmission. If the
millis()
counter wraps (every 49 days), this code might have a problem:For example, say the first call to
millis()
returns 0xFFFFFFF0 and the second (or subsequent) call tomillis()
returns 0xFFFFFFFF:I would rewrite it like:
Now if
millis()
returns 0xFFFFFFF0 and 0xFFFFFFFF, as above:As another example, if
millis()
returns 0xFFFFFFFF and 0x0000000F:Note: I chose 0xFFFFFFF0 and 0xFFFFFFFF for purposes of illustration, but it could just as well be 0xFFFFFFFE and 0xFFFFFFFF, for example (which might be more likely in real life).
The text was updated successfully, but these errors were encountered: