diff options
author | Keith Packard <keithp@keithp.com> | 2014-07-19 22:35:30 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-08-14 19:08:19 -0700 |
commit | d8e2b661e895fc59ded002a02191dcccce75f548 (patch) | |
tree | 5a69b7438fe91a26f31d082b60c2af93ac4029b4 /src/kernel | |
parent | 59976c44d1b6ee6505cfa4efd9a26ec4302f6c33 (diff) |
altos: Have MicroKite just start recording at startup
This avoids having MicroKite try to detect boost and has it just start
recording data immediately.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/ao_microflight.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/kernel/ao_microflight.c b/src/kernel/ao_microflight.c index df624e79..f7521f21 100644 --- a/src/kernel/ao_microflight.c +++ b/src/kernel/ao_microflight.c @@ -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 } } |