mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
restart with AVR WDT or ESP.restart()
This commit is contained in:
parent
03372f21e2
commit
2890a7928b
@ -38,7 +38,9 @@
|
|||||||
#include "DIAG.h"
|
#include "DIAG.h"
|
||||||
#include "TrackManager.h"
|
#include "TrackManager.h"
|
||||||
#include "DCCTimer.h"
|
#include "DCCTimer.h"
|
||||||
|
#ifdef HAS_AVR_WDT
|
||||||
#include <avr/wdt.h>
|
#include <avr/wdt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// These keywords are used in the <1> command. The number is what you get if you use the keyword as a parameter.
|
// These keywords are used in the <1> command. The number is what you get if you use the keyword as a parameter.
|
||||||
@ -775,8 +777,12 @@ bool DCCEXParser::parseD(Print *stream, int16_t params, int16_t p[])
|
|||||||
|
|
||||||
case HASH_KEYWORD_RESET:
|
case HASH_KEYWORD_RESET:
|
||||||
{
|
{
|
||||||
|
#ifdef HAS_AVR_WDT
|
||||||
wdt_enable( WDTO_15MS); // set Arduino watchdog timer for 15ms
|
wdt_enable( WDTO_15MS); // set Arduino watchdog timer for 15ms
|
||||||
delay(50); // wait for the prescaller time to expire
|
delay(50); // wait for the prescaller time to expire
|
||||||
|
#else
|
||||||
|
ESP.restart();
|
||||||
|
#endif
|
||||||
break; // and <X> if we didnt restart
|
break; // and <X> if we didnt restart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user