fix(led): stop WS2812 refresh when frame is unchanged so 'off' stays dark#66
Open
mitchross wants to merge 2 commits into
Open
fix(led): stop WS2812 refresh when frame is unchanged so 'off' stays dark#66mitchross wants to merge 2 commits into
mitchross wants to merge 2 commits into
Conversation
…dark The LED task rewrote an identical frame to the WS2812 strip every 20ms, keeping the data line permanently active. The Zigbee + BLE sensor push every 10 seconds (radio TX burst, with DFS enabled) can corrupt one of those frames, so the pixels briefly latch a random color - visible as a blink every ~10s even with brightness set to off. Only write to the strip when the frame actually changes. After a change, repeat the frame for 500ms so a corrupted transition write self-heals. While visibly lit, refresh once per second as a safety net. Once settled at off, keep the data line fully idle so nothing can flash at night. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A commissioned device that cannot reach its coordinator (powered off, out of range, network gone) failed initialization 5 times and then called esp_restart() - which changes nothing, so the device boot-looped every ~17 seconds forever. Each boot also flashed the LED before the saved brightness loaded from NVS, so a device with brightness set to off blinked all night. - Reboot at most once per power cycle (skip when the last reset was already our own SW restart), then keep retrying initialization with exponential backoff capped at REJOIN_BACKOFF_MAX_MS (5 min). - Start led_intensity at 0 so boots stay dark until button_init() loads the saved brightness. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #65
Problem
With brightness set to off, the LEDs blink faintly every ~10 seconds (visible in a dark room). The cadence matches the Zigbee + BLE sensor push in
main.c.led_taskrewrites an identical frame to the WS2812 pixels every 20 ms, keeping the data line permanently active. A frame that coincides with the 10-second radio TX burst can get corrupted, so the pixels briefly latch a random color even at intensity 0.Fix
In
led_task:Also restructures the duplicated mutex/fallback branches into a single read-then-write path.
Testing
🤖 Generated with Claude Code