-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CDC FIFO used getting out of sync
... by deleting it. I found a .blit that would reliably fail to flash (99% bug). Adding any extra logging to the USB code caused it to work, as did writing extra data at the end. Then I noticed that the read index was sometimes behind the write index by several entries, but "used" was 0. I think this is what was happening: - FIFO write is called from the USB interupt - write increments "used", read decrements it - those inc/decs are actually "load, add, store" - interrupt can happen in the middle of that - write increments from interrupt in the middle of the decrement in read - "used" is now too low So, I deleted the used variable and checked the read/write index instead ... and that .blit now works reliably.
- Loading branch information
1 parent
69e18ab
commit 5368ff3
Showing
2 changed files
with
3 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters