root / trunk / toolbox / reset.c @ 202
History | View | Annotate | Download (459 Bytes)
1 |
#include <avr/wdt.h> |
---|---|
2 |
|
3 |
/**
|
4 |
* This function resets the board, resetting the hardware back to almost the
|
5 |
* same state as a power on reset. Note that you must do the following in
|
6 |
* this order upon reset or the process will fail:
|
7 |
*
|
8 |
* 1. Reset WDRF in MCUSR to 0
|
9 |
* 2. call wdt_diable() to disable the watchdog in the right order
|
10 |
* 3. Set WDTCSR to clear out all traces of the watchdog timer
|
11 |
**/
|
12 |
void reset(void) { |
13 |
wdt_enable(WDTO_15MS); |
14 |
while(1); |
15 |
} |