diff options
author | Keith Packard <keithp@keithp.com> | 2017-04-30 17:42:23 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-04-30 17:42:23 -0700 |
commit | de36a1e1a2e568dd606000f169fef111e8c08b15 (patch) | |
tree | 44f0168ade4167d6095f160eedd1affb67634cd0 /src | |
parent | 9a10a209749d1f375d02ce9af68ccbb0b3a91ba2 (diff) |
altos/telegps-v2.0: Reorder initialization sequence
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/telegps-v2.0/ao_telegps.c | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/src/telegps-v2.0/ao_telegps.c b/src/telegps-v2.0/ao_telegps.c index 7a923d11..998c2008 100644 --- a/src/telegps-v2.0/ao_telegps.c +++ b/src/telegps-v2.0/ao_telegps.c @@ -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; |