An implementation of the mc1322x watchdog
This commit is contained in:
parent
88f9d79053
commit
7a310935d8
@ -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);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user