diff options
| author | Keith Packard <keithp@keithp.com> | 2009-04-14 21:23:55 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-04-14 21:23:55 -0700 | 
| commit | 9605045164882b4ca3d1317ac860b02513a51f30 (patch) | |
| tree | 06ea27ec13199004e3d1e15d4c49ebffa26f780d | |
| parent | dc844ee7e49a3b6145b3165252a592ed070d600f (diff) | |
use red LED to indicate system startup
| -rw-r--r-- | ao_flight.c | 20 | ||||
| -rw-r--r-- | ao_main.c | 12 | 
2 files changed, 20 insertions, 12 deletions
| diff --git a/ao_flight.c b/ao_flight.c index f31b4cd4..5060b53c 100644 --- a/ao_flight.c +++ b/ao_flight.c @@ -20,15 +20,15 @@  /* Main flight thread. */ -__xdata struct ao_adc	ao_flight_data; -__data enum flight_state	ao_flight_state; -__data uint16_t			ao_flight_state_tick; -__data int16_t			ao_flight_accel; -__data int16_t			ao_flight_pres; -__data int16_t			ao_ground_pres; -__data int16_t			ao_ground_accel; -__data int16_t			ao_min_pres; -__data uint16_t			ao_launch_time; +__xdata struct ao_adc		ao_flight_data;		/* last acquired data */ +__data enum flight_state	ao_flight_state;	/* current flight state */ +__data uint16_t			ao_flight_state_tick;	/* time of last data */ +__data int16_t			ao_flight_accel;	/* filtered acceleration */ +__data int16_t			ao_flight_pres;		/* filtered pressure */ +__data int16_t			ao_ground_pres;		/* startup pressure */ +__data int16_t			ao_ground_accel;	/* startup acceleration */ +__data int16_t			ao_min_pres;		/* minimum recorded pressure */ +__data uint16_t			ao_launch_time;		/* time of launch detect */  /* Accelerometer calibration   * @@ -111,6 +111,8 @@ ao_flight(void)  				ao_flight_state_tick = ao_time();  				ao_report_notify();  			} +			/* signal successful initialization by turning off the LED */ +			ao_led_off(AO_LED_RED);  			break;  		case ao_flight_launchpad:  			if (ao_flight_accel < ACCEL_BOOST ||  @@ -24,12 +24,18 @@ main(void)  	while (!(SLEEP & SLEEP_XOSC_STB))  		; +	/* Turn on the red LED until the system is stable */ +	ao_led_init(); +	ao_led_on(AO_LED_RED); +  	ao_timer_init();  	ao_adc_init();  	ao_beep_init(); -	ao_led_init(); -	ao_usb_init(); -	ao_ee_init();  	ao_cmd_init(); +	ao_ee_init(); +	ao_flight_init(); +	ao_log_init(); +	ao_report_init(); +	ao_usb_init();  	ao_start_scheduler();  } | 
