|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
#include <atomic>
|
|
#include <atomic>
|
|
|
|
|
|
|
|
|
|
+#include <esp_task_wdt.h>
|
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/FreeRTOS.h>
|
|
|
#include <freertos/semphr.h>
|
|
#include <freertos/semphr.h>
|
|
|
#include <freertos/task.h>
|
|
#include <freertos/task.h>
|
|
@@ -215,6 +216,17 @@ class GxEPD2Display : public display::DisplayBuffer {
|
|
|
// until update() wakes it, runs one full refresh, then goes back to
|
|
// until update() wakes it, runs one full refresh, then goes back to
|
|
|
// sleep. Never returns; this is the task's entire body for its lifetime.
|
|
// sleep. Never returns; this is the task's entire body for its lifetime.
|
|
|
[[noreturn]] void update_task_loop_() {
|
|
[[noreturn]] void update_task_loop_() {
|
|
|
|
|
+ // Arduino.h's delay()/yield() and SPI.h's transfer() call
|
|
|
|
|
+ // esphome::App.feed_wdt() to keep this task's own long busy-waits and
|
|
|
|
|
+ // SPI write bursts from starving another task's watchdog - but
|
|
|
|
|
+ // feed_wdt() only resets the *calling* task's own subscription, and
|
|
|
|
|
+ // this task was never subscribed (only the main loop task is, by
|
|
|
|
|
+ // esphome's own setup). Every one of those calls was silently failing
|
|
|
|
|
+ // (esp_task_wdt_reset() logging "task not found"), which is at best
|
|
|
|
|
+ // useless and, going by a crash inside the same watchdog subsystem's
|
|
|
|
|
+ // idle-task hook right after a burst of that error, plausibly worse
|
|
|
|
|
+ // than useless. Subscribe for real so those resets land.
|
|
|
|
|
+ esp_task_wdt_add(nullptr);
|
|
|
while (true) {
|
|
while (true) {
|
|
|
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
|
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
|
|
uint32_t start = millis();
|
|
uint32_t start = millis();
|