Blink a LED 10 times using the watchdog "IRQ or reset" mode.
FIXME: once the device goes into sleeping mode with , hardware reset does not awake it. Only a power-off/power-on cycle does wake it up.
#include BOARD_H
#define TIMEOUT 250ms
HW_ISR( (watchdog0,irq), naked )
{
}
int main ( )
{
hwa( configure, PIN_LED, mode, digital_output );
sleep, enabled,
sleep_mode, power_down );
if (
hw(stat,core0).reset_by_watchdog ) {
hwa( disable, watchdog0 );
for (;;)
}
hwa( configure, watchdog0,
timeout, TIMEOUT,
action, irq_or_reset );
hw( enable, interrupts );
static uint8_t count ;
for(;;) {
hwa( disable, (watchdog0,irq) );
count++ ;
if ( count < 19 ) {
hwa( enable, (watchdog0,irq) );
}
}
}