From e44678ceba9095637af477c3cc6e41c8724c01f4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 2 Apr 2017 23:16:51 -0400 Subject: [PATCH] avr: Implement reset command Support restarting the mcu using the watchdog feature of AVR chips via a new reset command. Signed-off-by: Kevin O'Connor --- src/avr/watchdog.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/avr/watchdog.c b/src/avr/watchdog.c index f925a8d5..306f2cd8 100644 --- a/src/avr/watchdog.c +++ b/src/avr/watchdog.c @@ -7,6 +7,7 @@ #include // WDT_vect #include // wdt_enable #include "command.h" // shutdown +#include "irq.h" // irq_disable #include "sched.h" // DECL_TASK static uint8_t watchdog_shutdown; @@ -22,7 +23,7 @@ watchdog_reset(void) { wdt_reset(); if (watchdog_shutdown) { - WDTCSR |= 1<