Project

General

Profile

Statistics
| Revision:

root / branches / lib_additions / code / lib / src / libdragonfly / reset.c @ 45

History | View | Annotate | Download (730 Bytes)

1
/*
2
reset.h - contains reset() function that resets the AVR
3
author: James Kong
4

5
Last Modified:
6

7
3.7.2007 - James
8
    created reset.c
9
*/
10

    
11
#include <avr/interrupt.h>
12
#include <util/delay.h>
13
#include <reset.h>
14

    
15
/**
16
 * @defgroup reset Reset
17
 * Functions for manipulation the ADC on the dragonfly board.
18
 * All definitions may be found in analog.h.
19
 *
20
 * @{
21
 **/
22

    
23
/**
24
 * Resets the AVR when called.  Sets the watchdog timer and lets it overflow
25
 * to reset the AVR.  The reset clears all memory and resets all registers
26
 * with the exception of the Watchdog Reset Flag (WDRF) in the MCU Control
27
 * and Status Register (MCUCSR).
28
 **/
29
void reset(void) {
30
    WDTCR &= 0xF8;
31
    WDTCR |= 0x08;
32
    _delay_ms(15);
33
}
34

    
35
/**@}**/ //end defgroup