Skip to content

Persist brightness level across reboots#24

Open
Swissola wants to merge 3 commits into
anthropics:mainfrom
Swissola:fix/brightness-persist
Open

Persist brightness level across reboots#24
Swissola wants to merge 3 commits into
anthropics:mainfrom
Swissola:fix/brightness-persist

Conversation

@Swissola
Copy link
Copy Markdown

Summary

  • Add \Settings::bright\ (0..4) to the NVS-backed settings struct so the brightness selection survives power cycles
  • Previously \�rightLevel\ was a runtime-only global that always reset to level 4 on boot
  • Move \settingsLoad()\ before \�pplyBrightness()\ in \setup()\ so the saved value is applied on first draw
  • Call \settingsSave()\ immediately when brightness changes (consistent with all other settings toggles)

Motivation

Every other setting (sound, BLE, LED, HUD, clock rotation) already persists across reboots via NVS. Brightness was the only one that didn't, silently reverting to the default on every power cycle.

Test plan

  • Set brightness to any level other than 4
  • Power cycle the device
  • Confirm brightness is restored to the saved level on boot

🤖 Generated with Claude Code

Swissola and others added 3 commits May 22, 2026 17:37
sleep=Donald Duck, idle=Bongo Cat, busy=SpongeBob multitasking,
attention=Surprised Pikachu (Nouns glasses), celebrate=Peanuts party,
dizzy=Powerpuff Girls spiral eyes, heart=heart eyes ghost.

Source GIFs in characters/memes-src/, device-ready pack in characters/memes/.
Built with prep_character.py at 96x98px, 64 colours per frame.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track the current peer BD address in onConnect (extended overload).
bleRemoveCurrentBond() removes only that peer's LTK from NVS. The
"unpair" JSON command now calls this instead of bleClearBonds(), so
each host unpairs itself independently. bleClearBonds() is reserved
for factory reset only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Settings::bright (0..4) to the NVS-backed settings struct so the
brightness selection survives power cycles. Previously brightLevel was a
runtime-only global that always reset to 4 on boot.

- Move settingsLoad() before applyBrightness() in setup() so the saved
  value is applied on first draw rather than the hardcoded default
- settingsSave() is now called immediately when brightness changes
  (it was already called for all other settings toggles)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant