Skip to content

Commit

Permalink
make WDT time longer to work around bootloader bug
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed May 11, 2024
1 parent 86291cb commit 2172d2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DCCTimerAVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand Down

0 comments on commit 2172d2e

Please sign in to comment.