This avoids having MicroKite try to detect boost and has it just start
recording data immediately.
Signed-off-by: Keith Packard <keithp@keithp.com>
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)
pa_ground = pa_sum >> GROUND_AVG_SHIFT;
pa_sum = 0;
sample_count = 0;
+#if !BOOST_DETECT
+ break;
+#endif
}
}
#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
ao_report_altitude();
ao_pips();
ao_log_micro_dump();
-
+#if BOOST_DELAY
ao_delay(BOOST_DELAY);
+#endif
ao_microflight();
#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 */