altos: Have MicroKite just start recording at startup
authorKeith Packard <keithp@keithp.com>
Sun, 20 Jul 2014 05:35:30 +0000 (22:35 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 15 Aug 2014 02:08:19 +0000 (19:08 -0700)
This avoids having MicroKite try to detect boost and has it just start
recording data immediately.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_microflight.c
src/microkite/ao_pins.h
src/product/ao_micropeak.c
src/product/ao_micropeak.h

index df624e7922275b6a2b0f4aef98f6ab59ab9cfe79..f7521f218cbb376b662c10bb82174a6ad1c75c58 100644 (file)
@@ -62,19 +62,25 @@ ao_microflight(void)
        h = 0;
        for (;;) {
                time += SAMPLE_SLEEP;
+#if BOOST_DETECT
                if ((sample_count & 0x1f) == 0)
                        ao_led_on(AO_LED_REPORT);
+#endif
                ao_delay_until(time);
                ao_microsample();
+#if BOOST_DETECT
                if ((sample_count & 0x1f) == 0)
                        ao_led_off(AO_LED_REPORT);
+#endif
                pa_hist[h] = pa;
                h = SKIP_PA_HIST(h,1);
                pa_diff = pa_ground - ao_pa;
 
+#if BOOST_DETECT
                /* Check for a significant pressure change */
                if (pa_diff > BOOST_DETECT)
                        break;
+#endif
 
                if (sample_count < GROUND_AVG * 2) {
                        if (sample_count < GROUND_AVG)
@@ -84,6 +90,9 @@ ao_microflight(void)
                        pa_ground = pa_sum >> GROUND_AVG_SHIFT;
                        pa_sum = 0;
                        sample_count = 0;
+#if !BOOST_DETECT
+                       break;
+#endif
                }
        }
 
index 3c56dfb86b3d03a86b02bf52988ebc6f6c9f6842..346b63a1be735011f76a1e36b89588533d45268f 100644 (file)
@@ -62,8 +62,9 @@ typedef int32_t alt_t;
 
 #define AO_ALT_VALUE(x)                ((x) * (alt_t) 10)
 
-#define BOOST_DETECT           1200    /* 100m (ish) */
+#define BOOST_DETECT              0    /* none */
 #define LOG_INTERVAL            200    /* 19.2 seconds */
+#define BOOST_DELAY            0
 
 #define AO_LOG_ID              AO_LOG_ID_MICROKITE
 
index 10f0d19206e436e08912fc69616a41c453a1ca25..54522d869aa1a8e8f895b73b46fae1b518a80b09 100644 (file)
@@ -73,8 +73,9 @@ main(void)
        ao_report_altitude();
        ao_pips();
        ao_log_micro_dump();
-       
+#if BOOST_DELAY        
        ao_delay(BOOST_DELAY);
+#endif
 
        ao_microflight();
 
index 396b9a235b60ac304107d1e6bcb45cedc503e59d..622f5a69700a13eda68311b8a0114691556c5efc 100644 (file)
@@ -41,7 +41,9 @@
 #endif
 
 /* Wait after power on before doing anything to give the user time to assemble the rocket */
+#ifndef BOOST_DELAY
 #define BOOST_DELAY            AO_SEC_TO_TICKS(60)
+#endif
 
 /* Pressure change (in Pa) to detect landing */
 #define LAND_DETECT            24      /* 2m at sea level, 2.4m at 2000m */