From 1554c5700e032d390b04a54434da7f2c0081c7dd Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:47:19 +1300 Subject: [PATCH] rp2040: Set watchdog to reboot properly (#3991) --- esphome/components/rp2040/core.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/rp2040/core.cpp b/esphome/components/rp2040/core.cpp index 2a1ce5a4d3..c20401c791 100644 --- a/esphome/components/rp2040/core.cpp +++ b/esphome/components/rp2040/core.cpp @@ -14,8 +14,9 @@ void IRAM_ATTR HOT delay(uint32_t ms) { ::delay(ms); } uint32_t IRAM_ATTR HOT micros() { return ::micros(); } void IRAM_ATTR HOT delayMicroseconds(uint32_t us) { delay_microseconds_safe(us); } void arch_restart() { - while (true) { // NOLINT(clang-diagnostic-unreachable-code) - yield(); + watchdog_reboot(0, 0, 10); + while (1) { + continue; } } void arch_init() { watchdog_enable(0x7fffff, false); }