Can't i use a watchdog in a program with an interrupt program and "wait" in the code?
If so, what do I have to write?
Watchdog with interup program, can i use watchdog?
-
- Posts: 149
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 93 times
- Been thanked: 17 times
- cicciocb
- Site Admin
- Posts: 2626
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 549 times
- Been thanked: 1861 times
- Contact:
Re: Watchdog with interup program, can i use watchdog?
The logic of the Watchdog is to put inside a loop that execute the main code.
In your case, if your program "waits", you could use a timer like this :
In your case, if your program "waits", you could use a timer like this :
Code: [Local Link Removed for Guests]
.....
timer0 5000, myWDT ' set a timer each 5 seconds
OPTION.WDT 10000 ' set the timeout at 10 seconds
.....
...
WAIT
myWDT:
OPTION.WDTRESET
return
-
- Posts: 149
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 93 times
- Been thanked: 17 times
Re: Watchdog with interup program, can i use watchdog?
Great, otherwise I always have to turn off the voltage using a fuse in the house when the ESP32 C Mini crashes ;-(
Thank you for the code.
Thank you for the code.