Most applications uses a wathdog.
In avr/arduino this is a buildin timer
I made small inline C code which init the watchdog, and resets the watchdog.
So far so good. But for test i dont give a resetwatchdog, thus the watchdog fires.
Then something happens which is not normal
The arduino comes in a kind of loop, see the LED flashing fast, and it isnt possible to load new application.
anyone knows why? The arduino should reboot, but hangs in some loop. Even pressing the resetswitch doesnt work.
calling the init is like:
calling the reset is line
In avr/arduino this is a buildin timer
I made small inline C code which init the watchdog, and resets the watchdog.
So far so good. But for test i dont give a resetwatchdog, thus the watchdog fires.
Then something happens which is not normal
The arduino comes in a kind of loop, see the LED flashing fast, and it isnt possible to load new application.
anyone knows why? The arduino should reboot, but hangs in some loop. Even pressing the resetswitch doesnt work.
B4X:
#if C
#include <avr/wdt.h>
void WatchdogInit (B4R::Object* o) {
wdt_enable (WDTO_2S);
}
void WatchdogReset (B4R::Object* o) {
wdt_reset ();
}
void wdt_disable (B4R::Object* o) {
wdt_disable() ;
}
#End if
calling the init is like:
B4X:
RunNative("WatchdogInit", Null)
B4X:
RunNative("WatchdogReset", Null)