fix: per-panel BWRY code table + 4-gray table additions (M3)#102
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
BWRY nibbles were hardcoded to the u8Colors_4clr_v2 order (black/white/ yellow=2/red=3). Panels 0x001D/0x001E (EP29YR) use u8Colors_4clr, where the native codes are 2=red, 3=yellow, and the firmware direct-write path streams the nibble raw — so yellow and red rendered swapped on those panels. Add a per-panel BWRY code table (get_bwry_codes) analogous to the 4-gray table, and apply it when encoding BWRY in prepare_image via encode_2bpp(codes=...). Also add the EP368_792x528_4GRAY (0x0048) V2 code entry (its mid-grays were swapped) and the missing 4-gray panel ids 0x0043/0x0044/0x0046/0x004C to PANELS_4GRAY. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JRrm95f1qNZzDM9r2SB6KW
736ba80 to
c47608c
Compare
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
M3 — BWRY red/yellow swapped on EP29YR panels (🟠)
BWRY wire nibbles were hardcoded to the
u8Colors_4clr_v2order (black=0/white=1/yellow=2/red=3). Panel tags 0x001D/0x001E (EP29YR_128x296 / EP29YR_168x384) useu8Colors_4clr, where the native codes are2=red, 3=yellow, and the firmware direct-write path streams the nibble raw — so yellow and red rendered swapped on those panels.Fix: add a per-panel BWRY code table (
get_bwry_codes) analogous to the existing_GRAY4_CODES_BY_PANEL, and apply it when encoding BWRY inprepare_imageviaencode_2bpp(codes=...).encode_2bppgains an optional identity-defaultcodesLUT.4-gray table additions (🟡)
EP368_792x528_4GRAY(0x0048) V2 code entry (its mid-grays were swapped, matchingbb_ep.inl).0x0043/0x0044/0x0046/0x004C(and0x0048) toPANELS_4GRAY.Test plan
uv run pytest -q→ 448 passed (5 new tests: swap table for 0x001D/0x001E, identity default,encode_2bppapplies codes, EP368 V2 codes, PANELS_4GRAY membership)ruff,mypyclean🤖 Generated with Claude Code