Repository navigation
fix(config): don't dump config JSON to USB serial on save - #3070
Open
chinderdelis wants to merge 1 commit into
Open
chinderdelis wants to merge 1 commit into
chinderdelis wants to merge 1 commit into
Conversation
serializeJsonPretty() wrote the whole config to Serial on every save. With nothing draining the USB-CDC endpoint, HWCDC::write() times out (100 ms x 20) and the loop task stalls, freezing the UI. Remove the debug dumps from saveFile(), loadFile() and createFile(); the explicit settings CLI dump is kept.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed Changes
BruceConfig::saveFile(),BruceConfigPins::loadFile()andBruceConfigPins::createFile()serialized the whole config JSON toSerialon every save. On USB-CDC builds that is a sizable write (~1.7 KB with the default config). When the host does not drain the CDC endpoint,HWCDC::write()waits fortx_timeout_ms(100 ms) and gives up aftermax_consec_timeouts(20), so the loop task is blocked for a long time while input/touch tasks keep running: the UI appears frozen.Reproducible on a touch board by opening the Brightness menu and pressing Sel to save with no serial monitor attached. The screen stops updating until the CDC endpoint is drained (opening a serial monitor and pressing a key is enough).
Remove the unconditional debug dumps. The explicit
settingsserial command still prints the JSON, so debugging is unaffected.Types of Changes
Bugfix
Verification
settings bright 100, brightness menu drag+Sel and other config-saving menus stay responsive.settingsCLI still dumps the full config as before.Testing
Hardware tested on Freenove FNK0104AB; compile-tested on ES3C28P.
Linked Issues
N/A
User-Facing Change
Further Comments
N/A