Ultrawipf / OpenFFBoard

OpenFFBoard is a universal force feedback interface for DIY simulation devices
https://hackaday.io/project/163904-open-ffboard
MIT License
558 stars 117 forks source link

Fixing usb cdc replies sometimes not being sent back #78

Closed Ultrawipf closed 2 years ago

Ultrawipf commented 2 years ago

This fixes an issue that occurs sometimes when the board is connected to a root hub usb port (directly to mainboard, no external usb hub). It is likely that the cause is a race condition only affecting replies with a certain timing between receiving and sending.

As a fix replies can be buffered by the CDC command interface until their size reaches a limit or the batch of commands is done processing. Then its sent out instead of immediately after each command has been processed. This can increase heap usage so the stack size of some tasks was adjusted to give a bit more headroom.