altos/telemini-v2.0: Change initialization order
authorKeith Packard <keithp@keithp.com>
Sun, 15 Sep 2013 21:29:09 +0000 (14:29 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 15 Sep 2013 21:29:09 +0000 (14:29 -0700)
Make sure busses are running before devices are initialized

Signed-off-by: Keith Packard <keithp@keithp.com>
src/telemini-v2.0/ao_telemini.c

index 294f768a5dd188ec8ce90acf050d79834e57a82d..0d8dd1cb637785bdffe8f7f4794e3c25ddba80b4 100644 (file)
@@ -24,36 +24,42 @@ __xdata uint8_t ao_force_freq;
 void
 main(void)
 {
 void
 main(void)
 {
-       /*
-        * Reduce the transient on the ignite pins at startup by
-        * pulling the pins low as soon as possible at power up
-        */
-       ao_ignite_set_pins();
-
        ao_clock_init();
 
        ao_clock_init();
 
+#if HAS_STACK_GUARD
+       ao_mpu_init();
+#endif
+       ao_task_init();
+
        /* Turn on the red LED until the system is stable */
        ao_led_init(LEDS_AVAILABLE);
        ao_led_on(AO_LED_RED);
 
        /* Turn on the red LED until the system is stable */
        ao_led_init(LEDS_AVAILABLE);
        ao_led_on(AO_LED_RED);
 
-       ao_task_init();
-
        ao_timer_init();
        ao_timer_init();
+
+       ao_spi_init();
+       ao_exti_init();
        ao_adc_init();
        ao_adc_init();
+#if HAS_BEEP
        ao_beep_init();
        ao_beep_init();
+#endif
        ao_cmd_init();
        ao_cmd_init();
-       ao_spi_init();
-       ao_exti_init();
+#if HAS_MS5607
        ao_ms5607_init();
        ao_ms5607_init();
+#endif
        ao_storage_init();
        ao_storage_init();
+
        ao_flight_init();
        ao_log_init();
        ao_report_init();
        ao_flight_init();
        ao_log_init();
        ao_report_init();
+
        ao_usb_init();
        ao_telemetry_init();
        ao_radio_init();
        ao_packet_slave_init(TRUE);
        ao_usb_init();
        ao_telemetry_init();
        ao_radio_init();
        ao_packet_slave_init(TRUE);
+
        ao_igniter_init();
        ao_igniter_init();
+
        ao_config_init();
        ao_start_scheduler();
 }
        ao_config_init();
        ao_start_scheduler();
 }