MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_application_init

Function rt_application_init

bsp/efm32/application.c:722–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722int rt_application_init()
723{
724 rt_thread_t demo_thread, led_thread;
725
726#if defined(EFM32_USING_ACCEL)
727 if (efm_accel_init() != RT_EOK)
728 {
729 rt_kprintf("*** Init accelerometer driver failed!");
730 while(1); //Or do something?
731 }
732#endif
733
734#if defined(EFM32_USING_SFLASH)
735 if (efm_spiFlash_init() != RT_EOK)
736 {
737 rt_kprintf("*** Init SPI Flash driver failed!");
738 while(1); //Or do something?
739 }
740#endif
741
742#if defined(EFM32_USING_SPISD)
743 if (efm_spiSd_init() != RT_EOK)
744 {
745 rt_kprintf("*** Init SD card driver failed!");
746 while(1); //Or do something?
747 }
748#endif
749
750 /* Initialize all device drivers (dev_?.c) */
751 if (rt_hw_led_init() != RT_EOK)
752 {
753 rt_kprintf("*** Init LED driver failed!");
754 while(1); //Or do something?
755 }
756#if defined(RT_USING_MISC)
757 if (rt_hw_misc_init() != RT_EOK)
758 {
759 rt_kprintf("*** Init miscellaneous driver failed!");
760 while(1); //Or do something?
761 }
762#endif
763
764#if defined(RT_USING_LWIP)
765 {
766 /* Create Ethernet Threads */
767 if (eth_system_device_init() != RT_EOK)
768 {
769 rt_kprintf("*** Create Ethernet threads failed!");
770 while(1); //Or do something?
771 }
772 #if defined(EFM32_USING_ETHERNET)
773 if (efm_hw_eth_init() != RT_EOK)
774 {
775 rt_kprintf("*** Init Ethernet driver failed!");
776 while(1); //Or do something?
777 }
778 #endif
779 }

Callers 1

rtthread_startupFunction · 0.70

Calls 10

efm_accel_initFunction · 0.85
rt_kprintfFunction · 0.85
efm_spiFlash_initFunction · 0.85
efm_spiSd_initFunction · 0.85
rt_hw_misc_initFunction · 0.85
eth_system_device_initFunction · 0.85
efm_hw_eth_initFunction · 0.85
rt_thread_createFunction · 0.85
rt_thread_startupFunction · 0.85
rt_hw_led_initFunction · 0.70

Tested by

no test coverage detected