summaryrefslogtreecommitdiff
path: root/n/avr
diff options
context:
space:
mode:
authorschodet2004-07-22 13:56:33 +0000
committerschodet2004-07-22 13:56:33 +0000
commitffe7e636c41e401f7d690d46e10a81cd702248b6 (patch)
tree731c8ef9f6a7814183e6555db3f34fb77e8db83c /n/avr
parenteab040297ae4316fd3816be9542e48e94f348485 (diff)
Ajour de reset().
Diffstat (limited to 'n/avr')
-rw-r--r--n/avr/utils/test_utils.c1
-rw-r--r--n/avr/utils/utils.h12
2 files changed, 13 insertions, 0 deletions
diff --git a/n/avr/utils/test_utils.c b/n/avr/utils/test_utils.c
index 27d5627..7b2ea09 100644
--- a/n/avr/utils/test_utils.c
+++ b/n/avr/utils/test_utils.c
@@ -34,6 +34,7 @@ main (void)
//delay_ns (1000000);
//delay_s (1);
delay_s (60);
+ reset ();
while (1)
;
}
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