aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-main.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-07-31 14:54:28 -0600
committerSelene ToyKeeper2019-07-31 14:54:28 -0600
commit51ea1b126516865b93d7cb8cabfc96910ff12ed0 (patch)
treea4896bb59a3a5cfa20c95cd8f5903a9b00e67d2b /spaghetti-monster/fsm-main.c
parentmf01-mini: enable aux LED low mode (diff)
parentensure muggle thermal step-down can't overflow or wrap around (diff)
downloadanduril-51ea1b126516865b93d7cb8cabfc96910ff12ed0.tar.gz
anduril-51ea1b126516865b93d7cb8cabfc96910ff12ed0.tar.bz2
anduril-51ea1b126516865b93d7cb8cabfc96910ff12ed0.zip
merged from upstream fsm branch to get factory reset function and other updates
Diffstat (limited to 'spaghetti-monster/fsm-main.c')
-rw-r--r--spaghetti-monster/fsm-main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c
index 6f74e9b..1c28f5f 100644
--- a/spaghetti-monster/fsm-main.c
+++ b/spaghetti-monster/fsm-main.c
@@ -40,6 +40,11 @@ int main() {
// Don't allow interrupts while booting
cli();
+ #ifdef USE_REBOOT // prevent reboot loops
+ MCUSR &= ~(1<<WDRF); // reset status flag
+ wdt_disable();
+ #endif
+
#ifdef HALFSPEED
// run at half speed
CLKPR = 1<<CLKPCE;