fix: complete HM42 monochrome image planes
This commit is contained in:
1 parent
3db8295654
commit
092b104e3d
4 files changed
+52
-1
No files matched your search
@@ -29,6 +29,17 @@ def select_rxtx_uuid(firmware_revision: str | None) -> str:
|
||||
return RXTX_CHAR_UUID_LEGACY
|
||||
return RXTX_CHAR_UUID
|
||||
|
||||
|
||||
def requires_complete_image_planes(firmware_revision: str | None) -> bool:
|
||||
"""Whether a nominally mono full-screen upload still needs both planes.
|
||||
|
||||
The HM42 Web-BLE implementation always sends the 400x300 black/white plane
|
||||
followed by a red plane before opcode 01. Omitting the second plane leaves
|
||||
HM42 rendering stale/uninitialised red data (observed as a red noisy screen).
|
||||
"""
|
||||
revision = (firmware_revision or "").strip().upper()
|
||||
return revision.startswith("HM42_AIO")
|
||||
|
||||
MODES = {
|
||||
**{f"image{i}": bytes([0xE1, 0x00, 0x00 + i]) for i in range(4)},
|
||||
"calendar1": bytes.fromhex("e10103"),
|
||||
|
||||
Reference in new issue
Block a user