An implementation of the mc1322x watchdog

This commit is contained in:
Adam Dunkels 2013-11-22 15:54:06 +01:00
parent 88f9d79053
commit 7a310935d8

View file

@ -34,30 +34,38 @@
*/
#include "dev/watchdog.h"
#include <mc1322x.h>
#include <board.h>
/*---------------------------------------------------------------------------*/
void
watchdog_init(void)
{
cop_timeout_ms(1000);
}
/*---------------------------------------------------------------------------*/
void
watchdog_start(void)
{
CRM->COP_CNTLbits.COP_EN = 1;
}
/*---------------------------------------------------------------------------*/
void
watchdog_periodic(void)
{
cop_service();
}
/*---------------------------------------------------------------------------*/
void
watchdog_stop(void)
{
CRM->COP_CNTLbits.COP_EN = 0;
}
/*---------------------------------------------------------------------------*/
void
watchdog_reboot(void)
{
watchdog_start();
while(1);
}
/*---------------------------------------------------------------------------*/