-__pdata int16_t ao_interval_cur_min_accel;
-__pdata int16_t ao_interval_cur_max_accel;
-__pdata int16_t ao_interval_cur_min_pres;
-__pdata int16_t ao_interval_cur_max_pres;
-__pdata int16_t ao_interval_min_accel;
-__pdata int16_t ao_interval_max_accel;
-__pdata int16_t ao_interval_min_pres;
-__pdata int16_t ao_interval_max_pres;
-
-__data uint8_t ao_flight_adc;
-__pdata int16_t ao_raw_accel, ao_raw_accel_prev, ao_raw_pres;
-__pdata int16_t ao_accel_2g;
-
-__xdata uint8_t ao_flight_force_idle;
-
-/* Accelerometer calibration
- *
- * We're sampling the accelerometer through a resistor divider which
- * consists of 5k and 10k resistors. This multiplies the values by 2/3.
- * That goes into the cc1111 A/D converter, which is running at 11 bits
- * of precision with the bits in the MSB of the 16 bit value. Only positive
- * values are used, so values should range from 0-32752 for 0-3.3V. The
- * specs say we should see 40mV/g (uncalibrated), multiply by 2/3 for what
- * the A/D converter sees (26.67 mV/g). We should see 32752/3300 counts/mV,
- * for a final computation of:
- *
- * 26.67 mV/g * 32767/3300 counts/mV = 264.8 counts/g
- *
- * Zero g was measured at 16000 (we would expect 16384).
- * Note that this value is only require to tell if the
- * rocket is standing upright. Once that is determined,
- * the value of the accelerometer is averaged for 100 samples
- * to find the resting accelerometer value, which is used
- * for all further flight computations
- */
-
-#define GRAVITY 9.80665
-/* convert m/s to velocity count */
-#define VEL_MPS_TO_COUNT(mps) (((int32_t) (((mps) / GRAVITY) * (AO_HERTZ/2))) * (int32_t) ao_accel_2g)
-
-#define ACCEL_NOSE_UP (ao_accel_2g >> 2)
-#define ACCEL_BOOST ao_accel_2g
-#define ACCEL_COAST (ao_accel_2g >> 3)
-#define ACCEL_INT_LAND (ao_accel_2g >> 3)
-#define ACCEL_VEL_MACH VEL_MPS_TO_COUNT(200)
-#define ACCEL_VEL_BOOST VEL_MPS_TO_COUNT(5)
-
-int32_t accel_vel_mach;
-int32_t accel_vel_boost;
-
-/*
- * Barometer calibration
- *
- * We directly sample the barometer. The specs say:
- *
- * Pressure range: 15-115 kPa
- * Voltage at 115kPa: 2.82
- * Output scale: 27mV/kPa
- *
- * If we want to detect launch with the barometer, we need
- * a large enough bump to not be fooled by noise. At typical
- * launch elevations (0-2000m), a 200Pa pressure change cooresponds
- * to about a 20m elevation change. This is 5.4mV, or about 3LSB.
- * As all of our calculations are done in 16 bits, we'll actually see a change
- * of 16 times this though
- *
- * 27 mV/kPa * 32767 / 3300 counts/mV = 268.1 counts/kPa
- */
-
-#define BARO_kPa 268
-#define BARO_LAUNCH (BARO_kPa / 5) /* .2kPa, or about 20m */
-#define BARO_APOGEE (BARO_kPa / 10) /* .1kPa, or about 10m */
-#define BARO_COAST (BARO_kPa * 5) /* 5kpa, or about 500m */
-#define BARO_MAIN (BARO_kPa) /* 1kPa, or about 100m */
-#define BARO_INT_LAND (BARO_kPa / 20) /* .05kPa, or about 5m */
-#define BARO_LAND (BARO_kPa * 10) /* 10kPa or about 1000m */