ports/stm32: Fix print overload crash on stop. #127
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because the new VM abort feature doesn't instantly kill running C code anymore on stop... a script that's generating a large amount of print output will continue to fill the CDC buffers even after the script has been stopped and the USB IRQ is turned off.
When this happens usbd_cdc_tx_always() will get stuck for 500ms a character at a time time from the print output. While the camera has not technically crashed... it will fall off the USB bus and generally become unresponsive.
This fix causes the loop to exit using the same conditions already built-into the code right now.