Found while bringing Firmware_NRF54 to parity (see OpenDisplay/Firmware_NRF54#2).
getBitsPerPixel() in src/display_service.cpp returns 1 for COLOR_SCHEME_GRAY16 (only BWGBRY→4, BWRY→2, GRAY4→2 are special-cased), so the direct-write path sizes a 16-gray upload as ceil(w/8)*h bytes — a 1bpp image.
But the client stack sends 16-gray as 4bpp (2 pixels/byte): py-opendisplay routes GRAYSCALE_16 through encode_4bpp() (src/opendisplay/encoding/images.py:97-100), i.e. 4× the byte count the firmware expects. The compressed path enforces the declared size exactly, so a client GRAY16 upload should be length-rejected (or, uncompressed, auto-complete at 1/4 of the image).
The nRF54 port deliberately expects 4bpp for GRAY16 (opendisplay_display_color.c), matching the client. Suggest aligning this firmware to 4bpp for GRAY16 as well — unless there's a known GRAY16 panel path that really consumes a 1-bit plane here, in which case the client side is the bug and that should be decided explicitly.
🤖 Generated with Claude Code
https://claude.ai/code/session_012g2e8mr132vcizx92WsgiR
Found while bringing Firmware_NRF54 to parity (see OpenDisplay/Firmware_NRF54#2).
getBitsPerPixel()insrc/display_service.cppreturns 1 forCOLOR_SCHEME_GRAY16(only BWGBRY→4, BWRY→2, GRAY4→2 are special-cased), so the direct-write path sizes a 16-gray upload asceil(w/8)*hbytes — a 1bpp image.But the client stack sends 16-gray as 4bpp (2 pixels/byte):
py-opendisplayroutesGRAYSCALE_16throughencode_4bpp()(src/opendisplay/encoding/images.py:97-100), i.e. 4× the byte count the firmware expects. The compressed path enforces the declared size exactly, so a client GRAY16 upload should be length-rejected (or, uncompressed, auto-complete at 1/4 of the image).The nRF54 port deliberately expects 4bpp for GRAY16 (
opendisplay_display_color.c), matching the client. Suggest aligning this firmware to 4bpp for GRAY16 as well — unless there's a known GRAY16 panel path that really consumes a 1-bit plane here, in which case the client side is the bug and that should be decided explicitly.🤖 Generated with Claude Code
https://claude.ai/code/session_012g2e8mr132vcizx92WsgiR