From 2172d2e1754fd9dbe87cf2c8c80a3ddab0bf9185 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 11 May 2024 08:46:25 +0200 Subject: [PATCH] make WDT time longer to work around bootloader bug --- DCCTimerAVR.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DCCTimerAVR.cpp b/DCCTimerAVR.cpp index 2806b07..656ba7e 100644 --- a/DCCTimerAVR.cpp +++ b/DCCTimerAVR.cpp @@ -185,8 +185,10 @@ int DCCTimer::freeMemory() { } void DCCTimer::reset() { - wdt_enable( WDTO_15MS); // set Arduino watchdog timer for 15ms - delay(50); // wait for it to happen + // 250ms chosen to circumwent bootloader bug which + // hangs at too short timepout (like 15ms) + wdt_enable( WDTO_250MS); // set Arduino watchdog timer for 250ms + delay(500); // wait for it to happen }