altos/telegps-v2.0: Reorder initialization sequence
authorKeith Packard <keithp@keithp.com>
Mon, 1 May 2017 00:42:23 +0000 (17:42 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 1 May 2017 00:42:23 +0000 (17:42 -0700)
This tries to be a bit more logical about the board initialization
sequence, starting with the OS, then the support hardware, internal
drivers, external drivers and finally services.

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

index 7a923d11dcee264dc90cb863cfe246647170617e..998c20086ccccbfeea4270df7aecdce0572429e2 100644 (file)
@@ -25,43 +25,35 @@ int
 main(void)
 {
        ao_clock_init();
+       ao_task_init();
+       ao_cmd_init();
+       ao_config_init();
 
-#if HAS_STACK_GUARD
-       ao_mpu_init();
-#endif
+       ao_led_init(LEDS_AVAILABLE);
+       ao_led_on(AO_LED_GREEN);
 
-       ao_task_init();
+       /* internal systems */
        ao_timer_init();
-
-       ao_spi_init();
+       ao_dma_init();
        ao_exti_init();
 
-       ao_storage_init();
-
+       /* SoC hardware */
+       ao_adc_init();
        ao_serial_init();
-
-       ao_cmd_init();
-
+       ao_spi_init();
        ao_usb_init();
-       ao_radio_init();
-
-#if HAS_ADC
-       ao_adc_init();
-#endif
 
+       /* External hardware */
+       ao_storage_init();
+       ao_radio_init();
        ao_gps_init();
-#if HAS_LOG
-       ao_log_init();
-#endif
-
-       ao_tracker_init();
 
+       /* Services */
+       ao_log_init();
        ao_telemetry_init();
+       ao_tracker_init();
 
-#if HAS_SAMPLE_PROFILE
-       ao_sample_profile_init();
-#endif
-       ao_config_init();
+       ao_led_off(AO_LED_GREEN);
 
        ao_start_scheduler();
        return 0;