Repository navigation
fix(cyd): persist Invert Color setting across reboots - #3059
Open
jtpydk5gyh-alt wants to merge 1 commit into
Open
jtpydk5gyh-alt wants to merge 1 commit into
jtpydk5gyh-alt wants to merge 1 commit into
Conversation
On CYD-2432S028 and nm-cyd-c5, _post_setup_gpio() unconditionally forced colorInverted after begin_storage() had already loaded the user's value from bruceConf.json, so the "Invert Color" setting reverted on every reboot (BruceDevices#3053). Track whether colorInverted was loaded from the config file and apply the board-specific default only on first boot (no stored value). Once the user changes the setting it now persists, while fresh devices still get the correct panel default.
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
On CYD-2432S028 and nm-cyd-c5, the Invert Color setting in Settings reverted on every reboot.
begin_storage()loads the user'scolorInvertedvalue frombruceConf.jsonandbegin_tft()applies it correctly, but_post_setup_gpio()then unconditionally re-forcedcolorInvertedbased on the panel driver, overwriting the stored value on every boot.This tracks whether
colorInvertedcame from the config file (colorInvertedSet, not serialized) and applies the board-specific default only on first boot, when no value is stored. Once the user changes the setting it persists; fresh devices still get the correct panel default.These two boards are the only ones that forced the value inside
_post_setup_gpio()(after config load). Other boards set it in_setup_gpio(), which runs before the config is loaded and is unaffected.Types of Changes
Bugfix.
Verification
On a CYD-2432S028: open Settings → toggle Invert Color → reboot. The chosen value is now kept instead of reverting. On a device with no
bruceConf.json, the panel default is applied as before.Testing
Not covered by automated tests (no harness for board-specific GPIO setup in the repo). Change is limited to config-load bookkeeping and the two affected board files.
Linked Issues
Closes #3053
User-Facing Change
Further Comments
The default for fresh devices is unchanged; only user-modified values now persist.