summaryrefslogtreecommitdiff
path: root/src/ao.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-11-02 21:38:18 -0800
committerKeith Packard <keithp@keithp.com>2009-11-02 23:51:41 -0800
commit144db05f6b286a0450d486f69ce192632a2c0656 (patch)
treed30523ae45f96db1ffca15b842965ed9ff008ac3 /src/ao.h
parent17611788aadc9460287145a340a7c18bf63766aa (diff)
Add two-point accelerometer calibration.
Calibration now uses two values, one upside right and the other upside down instead of a single horizontal value. This allows the use of other accelerometers and compensates for variations in the divider circuit to provide more accurate data.
Diffstat (limited to 'src/ao.h')
-rw-r--r--src/ao.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ao.h b/src/ao.h
index 4cceefe1..22e8785f 100644
--- a/src/ao.h
+++ b/src/ao.h
@@ -117,8 +117,9 @@ ao_panic(uint8_t reason);
*/
/* Our timer runs at 100Hz */
-#define AO_MS_TO_TICKS(ms) ((ms) / 10)
-#define AO_SEC_TO_TICKS(s) ((s) * 100)
+#define AO_HERTZ 100
+#define AO_MS_TO_TICKS(ms) ((ms) / (1000 / AO_HERTZ))
+#define AO_SEC_TO_TICKS(s) ((s) * AO_HERTZ)
/* Returns the current time in ticks */
uint16_t
@@ -928,16 +929,17 @@ ao_igniter_init(void);
*/
#define AO_CONFIG_MAJOR 1
-#define AO_CONFIG_MINOR 1
+#define AO_CONFIG_MINOR 2
struct ao_config {
uint8_t major;
uint8_t minor;
uint16_t main_deploy;
- int16_t accel_zero_g;
+ int16_t accel_plus_g;
uint8_t radio_channel;
char callsign[AO_MAX_CALLSIGN + 1];
uint8_t apogee_delay;
+ int16_t accel_minus_g;
};
extern __xdata struct ao_config ao_config;