rp2040: Set watchdog to reboot properly (#3991)

This commit is contained in:
Jesse Hills 2022-11-03 20:47:19 +13:00 committed by GitHub
parent 5cf257b251
commit 1554c5700e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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); }