Skip to content

fix(cyd): persist Invert Color setting across reboots - #3059

Open
jtpydk5gyh-alt wants to merge 1 commit into
BruceDevices:mainfrom
jtpydk5gyh-alt:fix/cyd-color-inverted-persist
Open

jtpydk5gyh-alt wants to merge 1 commit into
BruceDevices:mainfrom
jtpydk5gyh-alt:fix/cyd-color-inverted-persist

Conversation

@jtpydk5gyh-alt

Copy link
Copy Markdown

Proposed Changes

On CYD-2432S028 and nm-cyd-c5, the Invert Color setting in Settings reverted on every reboot. begin_storage() loads the user's colorInverted value from bruceConf.json and begin_tft() applies it correctly, but _post_setup_gpio() then unconditionally re-forced colorInverted based on the panel driver, overwriting the stored value on every boot.

This tracks whether colorInverted came 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

Fix the "Invert Color" setting reverting on every reboot on CYD-2432S028 and nm-cyd-c5.

Further Comments

The default for fresh devices is unchanged; only user-modified values now persist.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CYD-2432S028: colours inverted since 1.16, Invert Color setting reverts on every reboot

1 participant