aboutsummaryrefslogtreecommitdiff
path: root/arch/attiny1616.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-19 01:47:40 -0700
committerSelene ToyKeeper2023-11-19 01:47:40 -0700
commite6909adcb1d44797e097dcf93ee7459276a4516a (patch)
treef9cf19bfe6d0d670750fa64a0b9a2e2d166392d9 /arch/attiny1616.c
parenttemporary fix for aux LEDs on avrdd; needs proper refactoring (diff)
downloadanduril-e6909adcb1d44797e097dcf93ee7459276a4516a.tar.gz
anduril-e6909adcb1d44797e097dcf93ee7459276a4516a.tar.bz2
anduril-e6909adcb1d44797e097dcf93ee7459276a4516a.zip
moved prevent_reboot_loop() and some other junk out of fsm/main.c
Diffstat (limited to 'arch/attiny1616.c')
-rw-r--r--arch/attiny1616.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/attiny1616.c b/arch/attiny1616.c
index 3b170bb..a3ead7e 100644
--- a/arch/attiny1616.c
+++ b/arch/attiny1616.c
@@ -145,3 +145,9 @@ void reboot() {
while (1) {}
}
+inline void prevent_reboot_loop() {
+ // prevent WDT from rebooting MCU again
+ RSTCTRL.RSTFR &= ~(RSTCTRL_WDRF_bm); // reset status flag
+ wdt_disable();
+}
+