diff --git a/src/panels/waveshare13e6/v1/epd_driver.cpp b/src/panels/waveshare13e6/v1/epd_driver.cpp index 5b8df9c..bea217f 100644 --- a/src/panels/waveshare13e6/v1/epd_driver.cpp +++ b/src/panels/waveshare13e6/v1/epd_driver.cpp @@ -243,9 +243,13 @@ static void push_full_frame(const uint8_t* fb) { for (uint16_t x = 0; x < HALF_BYTES_ROW; x++) { spi_write_byte(row[x]); } - // Yield to the watchdog every ~16 rows so it doesn't reset us - // during the multi-second per-half push. - if ((y & 0x0F) == 0) esp_task_wdt_reset(); + // Yield to scheduler (and feed the watchdog) every 8 rows + // so neither the task WDT nor the interrupt WDT bites during + // the multi-second bit-banged push. + if ((y & 0x07) == 0) { + esp_task_wdt_reset(); + vTaskDelay(0); + } } cs(cs_pin, HIGH); } @@ -263,7 +267,10 @@ void epd_fill(uint8_t color) { begin_cmd(p, 0x10); for (size_t i = 0; i < (size_t)HALF_BYTES_ROW * H; i++) { spi_write_byte(byte); - if ((i & 0x1FFF) == 0) esp_task_wdt_reset(); + if ((i & 0x0FFF) == 0) { + esp_task_wdt_reset(); + vTaskDelay(0); + } } cs(p, HIGH); }