Revision 81
attempted to merge lib_addtions to trunk
branches/lib_additions/math.h | ||
---|---|---|
1 |
/** |
|
2 |
* |
|
3 |
* @file math.h |
|
4 |
* @brief Contains math function(s) |
|
5 |
* |
|
6 |
* @author Colony Project, CMU Robotics Club, James Kong |
|
7 |
*/ |
|
8 |
|
|
9 |
#ifndef _MATH_H_ |
|
10 |
#define _MATH_H_ |
|
11 |
|
|
12 |
/** |
|
13 |
* @addtogroup math |
|
14 |
* @{ |
|
15 |
**/ |
|
16 |
|
|
17 |
/** @brief absolute value **/ |
|
18 |
int abs_int(int x); |
|
19 |
|
|
20 |
/**@}**/ //end group |
|
21 |
|
|
22 |
#endif |
branches/lib_additions/reset.c | ||
---|---|---|
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 |
branches/lib_additions/reset.h | ||
---|---|---|
1 |
/** |
|
2 |
* |
|
3 |
* @file reset.h |
|
4 |
* @brief Contains function(s) for resetting the robots |
|
5 |
* |
|
6 |
* @author Colony Project, CMU Robotics Club, James Kong |
|
7 |
*/ |
|
8 |
|
|
9 |
#ifndef _RESET_H_ |
|
10 |
#define _RESET_H_ |
|
11 |
|
|
12 |
/** |
|
13 |
* @addtogroup reset |
|
14 |
* @{ |
|
15 |
**/ |
|
16 |
|
|
17 |
/** @brief Reset the robot **/ |
|
18 |
void reset(void); |
|
19 |
|
|
20 |
/**@}**/ //end group |
|
21 |
|
|
22 |
#endif |
Also available in: Unified diff