samd21: Enable watchdog
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
afa58de014
commit
0af0bc946e
|
@ -11,6 +11,26 @@
|
|||
DECL_CONSTANT(MCU, "samd21g");
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* watchdog handler
|
||||
****************************************************************/
|
||||
|
||||
void
|
||||
watchdog_reset(void)
|
||||
{
|
||||
WDT->CLEAR.reg = 0xa5;
|
||||
}
|
||||
DECL_TASK(watchdog_reset);
|
||||
|
||||
void
|
||||
watchdog_init(void)
|
||||
{
|
||||
WDT->CONFIG.reg = WDT_CONFIG_PER_16K; // 500ms timeout
|
||||
WDT->CTRL.reg = WDT_CTRL_ENABLE;
|
||||
}
|
||||
DECL_INIT(watchdog_init);
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* misc functions
|
||||
****************************************************************/
|
||||
|
|
Loading…
Reference in New Issue