altos: Baro-only (but record accel) for TM v1.2 pwmin
authorKeith Packard <keithp@keithp.com>
Sun, 22 Jul 2012 05:18:35 +0000 (22:18 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 22 Jul 2012 05:18:35 +0000 (22:18 -0700)
Changes for ULA payload

Signed-off-by: Keith Packard <keithp@keithp.com>
src/cc1111/ao_pins.h
src/core/ao_sample.c
src/core/ao_telemetry.c

index fc6ed3ec280a0287fe1fe6b3b800cce4cc0364f6..c502b5ed72256a52f6220415a2929bf7ceabf067 100644 (file)
@@ -91,6 +91,7 @@
 #endif
 
 #if defined(TELEMETRUM_V_1_2)
+       #define RADIO_DELAY_AFTER_BOOST 40
        #define HAS_FLIGHT              1
        #define HAS_USB                 1
        #define HAS_BEEP                1
        #define SPI_CS_ON_P0            0
        #define AO_M25_SPI_CS_MASK      0x02    /* CS0 is P1_1 */
        #define M25_MAX_CHIPS           1
-       #define HAS_ACCEL               1
+       #define HAS_ACCEL               0
        #define HAS_IGNITE              1
        #define HAS_MONITOR             0
 #endif
 #error Please define HAS_ACCEL_REF
 #endif
 #else
+#ifndef HAS_ACCEL_REF
 #define HAS_ACCEL_REF 0
 #endif
+#endif
 
 #endif /* HAS_ADC */
 
index 6461def06abbb764a6ce5dc4e7ac6ed91dbd50d2..5fe99b051f0709d4c21ff9651c59a22afa6587bd 100644 (file)
@@ -34,7 +34,7 @@ __pdata uint16_t      ao_sample_tick;         /* time of last data */
 __pdata pres_t         ao_sample_pres;
 __pdata alt_t          ao_sample_alt;
 __pdata alt_t          ao_sample_height;
-#if HAS_ACCEL
+#if HAS_ACCEL || HAS_ACCEL_REF
 __pdata accel_t                ao_sample_accel;
 #endif
 
@@ -139,7 +139,7 @@ ao_sample(void)
                ao_sample_alt = pres_to_altitude(ao_sample_pres);
                ao_sample_height = ao_sample_alt - ao_ground_height;
 
-#if HAS_ACCEL
+#if HAS_ACCEL || HAS_ACCEL_REF
                ao_sample_accel = ao_data_accel_cook(ao_data);
                if (ao_config.pad_orientation != AO_PAD_ORIENTATION_ANTENNA_UP)
                        ao_sample_accel = ao_data_accel_invert(ao_sample_accel);
index 5a1b3d1d75ccfee1a72e6b2dc1a04553be26445a..8385c6d038c9f48dc9862af73f299e8cf64a438b 100644 (file)
@@ -285,7 +285,7 @@ ao_telemetry(void)
 
 #if RADIO_DELAY_AFTER_BOOST
        while (ao_flight_state < ao_flight_boost)
-               ao_sleep(&ao_flight_state);
+               ao_sleep(DATA_TO_XDATA(&ao_flight_state));
        ao_delay(AO_SEC_TO_TICKS(RADIO_DELAY_AFTER_BOOST));
 #endif