Repository navigation
T5S3 e-paper: grayscale driver with per pixel doses as default - #722
Conversation
- Split the board signalling into t5s3_epd_board.cpp, shared by both drivers - lilygo,t5s3-display (default): draw_bitmap() no longer waits for the panel. Changes are shown at once with a black and white dither, each changed area gets its 16 gray levels 3 s after its last change. Only changed pixels are driven, refresh() no longer blocks touch input - lilygo,t5s3-display-bw (new): black and white pixel state machine like the PaperS3 driver
…veform - lilygo,t5s3-display draws 7 shades with a dose of frames per pixel, in the manner of InkBoy - Frames of 40 ms cover the whole screen, so all changes show at once, the next frame is encoded on the other core - Every gray is reached the same way (15 light frames, a frame of rest, then its dark frames), so moving content leaves almost no trails - A frame that stalls makes the grays it interrupted start again - Only pixels whose shade changes are driven. refresh() flashes and draws the content again, the driver also does that when the content changed without touches (at most every 10 minutes) - The epdiy waveform and the update logic derived from epdiy are removed, only the board signalling stays LGPL - Doses, frame counts and shade brightness were measured with a camera on the panel
- Grays rest for 0 to 3 frames before their dark frames, each frame of rest makes a gray a little darker - That gives 16 shades close to each other, so the dither between neighbouring shades is hardly visible - AUTO_REFRESH_INTERVAL_MS is renamed to MINIMAL_AUTO_REFRESH_INTERVAL_MS - lilygo-t5-epd47-s3 uses lilygo,t5s3-display, the black and white driver stays in the devicetree as commented out lines in case someone prefers it
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
62358706-5ac5-400d-97fb-28e45c714803
Files selected for processing: 16-
Devices/lilygo-t5-epd47-s3/lilygo,t5-epd47-s3.dtsDrivers/lilygo-t5s3-epd-module/CMakeLists.txtDrivers/lilygo-t5s3-epd-module/README.mdDrivers/lilygo-t5s3-epd-module/bindings/lilygo,t5s3-display-bw.yamlDrivers/lilygo-t5s3-epd-module/bindings/lilygo,t5s3-display.yamlDrivers/lilygo-t5s3-epd-module/include/bindings/t5s3_display_bw.hDrivers/lilygo-t5s3-epd-module/include/drivers/t5s3_display_bw.hDrivers/lilygo-t5s3-epd-module/source/module.cppDrivers/lilygo-t5s3-epd-module/source/t5s3_display.cppDrivers/lilygo-t5s3-epd-module/source/t5s3_display_bw.cppDrivers/lilygo-t5s3-epd-module/source/t5s3_epd.cppDrivers/lilygo-t5s3-epd-module/source/t5s3_epd.hDrivers/lilygo-t5s3-epd-module/source/t5s3_epd_board.cppDrivers/lilygo-t5s3-epd-module/source/t5s3_epd_board.hDrivers/lilygo-t5s3-epd-module/source/t5s3_epd_rows.hDrivers/lilygo-t5s3-epd-module/source/t5s3_epd_waveform.h
Files with no reviewable changes: 4-
- Drivers/lilygo-t5s3-epd-module/source/t5s3_epd_waveform.h
- Drivers/lilygo-t5s3-epd-module/source/t5s3_epd.cpp
- Drivers/lilygo-t5s3-epd-module/source/t5s3_epd.h
- Drivers/lilygo-t5s3-epd-module/source/t5s3_epd_rows.h
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
- Black is driven for 18 frames, until grays drawn with it end their light frames. Before, a black line of 1 pixel on gray faded after a refresh. - A pending restart of the doses runs on the display task before both cores encode, so it no longer races with the encoding of the upper half.
- Black is driven for 18 frames, until grays drawn with it end their light frames. Before, a black line of 1 pixel on gray faded after a refresh. - A pending restart of the doses runs on the display task before both cores encode, so it no longer races with the encoding of the upper half. - User data is stored on the SD card
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Move the restart store after finish_helper() to remove the… · t5s3_display.cpp:202
Drivers/lilygo-t5s3-epd-module/source/t5s3_display.cpp:202
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winMove the
restartstore afterfinish_helper()to remove the unsynchronized access.
display_taskwritesrestartat line 600 during the active frame.helper_taskreads and clears the same field at lines 385-386 for the job it started at line 585. Nothing orders those accesses, so this is a data race on a non-atomicbool. If the helper task is preempted between its read and its clear, the store from the display task can be overwritten and that restart request is lost.Publish the flag after
finish_helper()returns. The helper's clear then happens before the display task's store, and the nextstart_helper()orders the store before the next read. The helper still applies the restart at the next job, as it does now.🐛 Suggested fix
- if (late_us > (encoding_late ? ENCODING_STALL_US : STALL_US) || frame_us > FRAME_PERIOD_US + STALL_US) { - internal->restart = true; - LOG_W(TAG, "Frame %d us late and %d us long, doses start again", static_cast<int>(late_us), static_cast<int>(frame_us)); - } const Encoded next = finish_helper(internal); + if (late_us > (encoding_late ? ENCODING_STALL_US : STALL_US) || frame_us > FRAME_PERIOD_US + STALL_US) { + internal->restart = true; + LOG_W(TAG, "Frame %d us late and %d us long, doses start again", static_cast<int>(late_us), static_cast<int>(frame_us)); + } encoding_late = esp_timer_get_time() > next_frame_us;

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
700b6d37-d882-4d09-86e5-cede191ae86e
Files selected for processing: 3-
Devices/lilygo-t5-epd47-s3/device.propertiesDrivers/lilygo-t5s3-epd-module/README.mdDrivers/lilygo-t5s3-epd-module/source/t5s3_display.cpp
Files skipped from review as they are similar to previous changes: 1-
- Drivers/lilygo-t5s3-epd-module/README.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
The display task set the restart flag while the helper task could read and clear it. It is now set after finish_helper(), so the helper sees it with its next job.
|
Thank you! |
Replaces the waveform of the grayscale driver
lilygo,t5s3-displaywith a per pixel dose of frames, using the method of InkBoy (only the method, no code). The devicelilygo-t5-epd47-s3now uses this driver. The black and white driver stays available as commented out lines in the devicetree. User data is now stored on the SD card, like on the T-Deck.How it works
refresh()flashes the panel and draws the content again. The driver also does that by itself when the content changed without touches, at most every 10 minutes.License
The epdiy waveform and the update logic derived from it are removed. Only the board signalling (
t5s3_epd_board.cpp/.h) stays LGPL.Testing
LILYGO T5 4.7 S3 V2.4: boot, launcher, Satellite Tracker with a gray map and moving markers. The shades and trails were measured with a camera on the panel.
Summary by CodeRabbit