Skip to content

fix(Inkplate6COLOR): yield during EPD busy-wait loops#305

Merged
JosipKuci merged 2 commits into
SolderedElectronics:masterfrom
lanrat:fix/yield-during-epd-busy-wait
May 21, 2026
Merged

fix(Inkplate6COLOR): yield during EPD busy-wait loops#305
JosipKuci merged 2 commits into
SolderedElectronics:masterfrom
lanrat:fix/yield-during-epd-busy-wait

Conversation

@lanrat
Copy link
Copy Markdown
Contributor

@lanrat lanrat commented May 20, 2026

The display() and clean() routines busy-wait on EPAPER_BUSY_PIN with empty loop bodies. Each panel refresh takes 15-30 seconds, during which the calling task monopolises its CPU core. On FreeRTOS multitasking apps this starves IDLE0, the ESP-IDF task watchdog (default 5 s) fires, and the device panic-resets.

Single-task Arduino sketches — the pattern used by the library's own examples — are unaffected because arduino-esp32 auto-feeds the loopTask watchdog after each loop() iteration.

Add delay(1) to each busy-wait loop so the scheduler can run IDLE and other tasks between polls. Loss of polling resolution is negligible (~1 ms on a 20 s operation, well below normal hardware response variance).

This brings Inkplate6COLOR in line with the existing (and correct) pattern already used by Inkplate13SPECTRA's waitForBusy() at src/boards/Inkplate13SPECTRA/Inkplate13SPECTRADriver.cpp:735

The display() and clean() routines busy-wait on EPAPER_BUSY_PIN with
empty loop bodies. Each panel refresh takes 15-30 seconds, during
which the calling task monopolises its CPU core. On FreeRTOS
multitasking apps this starves IDLE0, the ESP-IDF task watchdog
(default 5 s) fires, and the device panic-resets.

Single-task Arduino sketches — the pattern used by the library's
own examples — are unaffected because arduino-esp32 auto-feeds the
loopTask watchdog after each loop() iteration.

Add delay(1) to each busy-wait loop so the scheduler can run IDLE
and other tasks between polls. Loss of polling resolution is
negligible (~1 ms on a 20 s operation, well below normal hardware
response variance).

This brings Inkplate6COLOR in line with the existing — and correct —
pattern already used by Inkplate13SPECTRA's waitForBusy() at
src/boards/Inkplate13SPECTRA/Inkplate13SPECTRADriver.cpp:735, which
has been doing the right thing all along.
@JosipKuci JosipKuci self-requested a review May 21, 2026 06:45
I think the usage of the delay function is understandable in this scenario, no need to justify it.
@JosipKuci JosipKuci merged commit e6925a4 into SolderedElectronics:master May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants