Fix LCD booting with inverted colors on ST7789 displays - #404
Open
3rdIteration wants to merge 1 commit into
Open
Fix LCD booting with inverted colors on ST7789 displays#4043rdIteration wants to merge 1 commit into
3rdIteration wants to merge 1 commit into
Conversation
The ST7789 init sequences hardcode INVON (0x21) as a boot-time register step, independent of the "Invert colors" setting. Renderer only forced the register ON when the setting was enabled, never forced it OFF when disabled, so displays booted inverted until the setting was toggled. Now the renderer always syncs the hardware register to match the setting, both at boot and whenever the display driver is reloaded. Co-Authored-By: Claude Sonnet 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.
Summary
ST7789.py,st7789_mpy.py) hardcode INVON (0x21) as a boot-time register step, independent of the "Invert colors" setting.Renderer.initialize_display()only forced the hardware register ON when the setting was Enabled; it never forced it OFF when Disabled (the default), so the display booted inverted and stayed that way until the setting was toggled off/on in the Settings menu.st7789_320x240↔st7789_240x240), since driver swaps go through the sameinitialize_display()path.Test plan
pytest tests/ -k "renderer or display"— 10 passedpytest tests/suite — 898 passed, 135 skipped, 1 xfailed, 0 failed (excludingtest_smartcard_hardware.py, which requires a physical smartcard reader and is unaffected by this change)st7789_240x240/st7789_320x240🤖 Generated with Claude Code