From 228cea866504bdd7cbca2e06b42f9de789eb791a Mon Sep 17 00:00:00 2001 From: Steve Marple Date: Thu, 24 Jan 2013 20:28:53 +0000 Subject: [PATCH] Clear only the watchdog bit in MCUSR before resetting the watchdog. Preserve other bits so that user application can find out reason for reboot. --- xboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xboot.c b/xboot.c index ebedb66..3b79a58 100644 --- a/xboot.c +++ b/xboot.c @@ -309,7 +309,7 @@ int main(void) #ifndef __AVR_XMEGA__ // ATMEGA must reset via watchdog, so turn it off - MCUSR = 0; + MCUSR &= ~(1 << WDRF); wdt_disable(); #endif