altos: Auto-calibrate linux-based flight testing code
authorKeith Packard <keithp@keithp.com>
Sun, 16 Jan 2011 23:57:15 +0000 (15:57 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 17 Jan 2011 04:24:13 +0000 (20:24 -0800)
Use the provided ground acceleration average to set the two
accelerometer calibration values so that the flight code will
detect pad/idle mode correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_flight_test.c

index e0cfa47a2a8e3ecc11ffed2c87b36c39e7a4eae6..108d2c19fff5271beee64d45ef8a35542af6ec2e 100644 (file)
@@ -238,6 +238,8 @@ ao_sleep(void *wchan)
                        switch (type) {
                        case 'F':
                                ao_flight_ground_accel = a;
+                               ao_config.accel_plus_g = a;
+                               ao_config.accel_minus_g = a + 530;
                                ao_flight_started = 1;
                                break;
                        case 'S':