-->
Page 1 of 4

Has anyone successfully used the Watchdog timer on this IDE?

PostPosted: Tue Apr 28, 2015 12:43 am
by swilson
Just curious if anyone has used the watchdog timer with this IDE? I have tried #include <avr/wdt.h> but when compiling it gives an error of: fatal error: avr/wdt.h: No such file or directory.

Re: Has anyone successfully used the Watchdog timer on this

PostPosted: Tue Apr 28, 2015 4:53 am
by GerryKeely
Hi
Use
Code: Select allextern "C" {
#include "user_interface.h"
}


and you should be able to use the watchdog . Delete the ref. to <avr/wdt.h>( this is for Atmel micros only ,not the ESP8266)

Gerry

Re: Has anyone successfully used the Watchdog timer on this

PostPosted: Tue Apr 28, 2015 9:22 pm
by swilson
Ok good, I am already using that to track heap size.

Would I just enable watchdog by putting ESP.wdtEnable(WDTO_4S) in setup for example to have watchdog reset in 5 seconds if no ESP.wdtFeed() is seen in that time?

Re: Has anyone successfully used the Watchdog timer on this

PostPosted: Wed Apr 29, 2015 7:12 am
by GerryKeely
I don't think you can set a time delay as this is not yet implemented. You can enable, disable or reset(feed ?) the watchdog.

Gerry