cc2530 watchdog improvements and cleanup

This commit is contained in:
George Oikonomou 2012-04-27 11:47:50 +01:00
parent 274a5ebb9c
commit 0d4b90c42b
2 changed files with 9 additions and 11 deletions

View File

@ -14,6 +14,11 @@
#include <stdint.h>
/* In watchdog mode, our WDT can't be stopped once started
* Include watchdog_stop()'s declaration and then trash it */
#include "dev/watchdog.h"
#define watchdog_stop() watchdog_periodic()
/*
* lint - style defines to help syntax parsers with sdcc-specific 8051 code
* They don't interfere with actual compilation

View File

@ -39,7 +39,6 @@
* George Oikonomou - <oikonomou@users.sourceforge.net>
*/
#include "sys/energest.h"
#include "cc253x.h"
#include "sfr-bits.h"
#include "contiki-conf.h"
@ -67,22 +66,16 @@ watchdog_periodic(void)
}
/*---------------------------------------------------------------------------*/
void
watchdog_stop(void)
{
/* In watchdog mode, stopping is impossible so we just reset the timer */
watchdog_periodic();
}
/*---------------------------------------------------------------------------*/
void
watchdog_reboot(void)
{
WDCTL = WDT_TIMEOUT_MIN;
/* Dis-acknowledge all interrupts while we wait for the dog to bark */
DISABLE_INTERRUPTS();
WDCTL |= WDCTL_MODE1; /* Just in case it's not started... */
/* NOP till the dog barks... */
while(1) {
__asm
nop
__endasm;
ASM(nop);
}
}