summaryrefslogtreecommitdiff
path: root/n/avr/utils/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/utils/utils.h')
-rw-r--r--n/avr/utils/utils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/n/avr/utils/utils.h b/n/avr/utils/utils.h
index a2f9eb0..69c504b 100644
--- a/n/avr/utils/utils.h
+++ b/n/avr/utils/utils.h
@@ -26,6 +26,7 @@
#include "avrconfig.h"
#include <avr/delay.h>
+#include <avr/wdt.h>
#include <inttypes.h>
/** Delay in ns. Do not call this macro with a variable parameter. If you
@@ -92,4 +93,15 @@ delay_s (uint8_t s)
delay_ns (1000000000);
}
+extern inline void
+reset (void) __attribute__ ((noreturn));
+
+extern inline void
+reset (void)
+{
+ wdt_enable (WDTO_15MS);
+ while (1)
+ ;
+}
+
#endif // utils_h