diff options
| author | Keith Packard <keithp@keithp.com> | 2010-01-09 22:06:19 -0800 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-01-09 22:06:19 -0800 |
| commit | 0c2533be15858774ef9381aa8c8344356fd5b971 (patch) | |
| tree | 944069b9136942dc9bfde3cdcba4547e648050f8 /src/ao_telemetrum.c | |
| parent | 28346736a7799c0767e54511d9949cd61d35e471 (diff) | |
Force idle mode by shorting the SPI clock to ground at boot time.
This allows you to override the flight mode detection code in case the
accelerometer calibration is broken somehow. Hold the SPI clock shoted
to ground until the LED comes on, then remove it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_telemetrum.c')
| -rw-r--r-- | src/ao_telemetrum.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ao_telemetrum.c b/src/ao_telemetrum.c index 0de3572a..89743837 100644 --- a/src/ao_telemetrum.c +++ b/src/ao_telemetrum.c @@ -29,10 +29,20 @@ main(void) { ao_clock_init(); + /* Turn on the red LED until the system is stable */ ao_led_init(AO_LED_RED); ao_led_on(AO_LED_RED); + /* A hack -- look at the SPI clock pin, if it's sitting at + * ground, then we force the computer to idle mode instead of + * flight mode + */ + if (P1_3 == 0) { + ao_flight_force_idle = 1; + while (P1_3 == 0) + ; + } ao_timer_init(); ao_adc_init(); ao_beep_init(); |
