diff options
Diffstat (limited to 'src/components.c')
| -rw-r--r-- | src/components.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components.c b/src/components.c index 67658afde5..8280056153 100644 --- a/src/components.c +++ b/src/components.c @@ -125,6 +125,7 @@ void rt_components_init(void) } #endif } +#endif /* RT_USING_COMPONENTS_INIT */ #ifdef RT_USING_USER_MAIN @@ -152,7 +153,6 @@ int __low_level_init(void) return 0; } #elif defined(__GNUC__) -extern int main(void); /* Add -eentry to arm-none-eabi-gcc argument */ int entry(void) { @@ -173,10 +173,11 @@ void main_thread_entry(void *parameter) { extern int main(void); extern int $Super$$main(void); - + +#ifdef RT_USING_COMPONENTS_INIT /* RT-Thread components initialization */ rt_components_init(); - +#endif /* invoke system main function */ #if defined(__CC_ARM) || defined(__CLANG_ARM) $Super$$main(); /* for ARMCC. */ @@ -200,7 +201,7 @@ void rt_application_init(void) result = rt_thread_init(tid, "main", main_thread_entry, RT_NULL, main_stack, sizeof(main_stack), RT_MAIN_THREAD_PRIORITY, 20); RT_ASSERT(result == RT_EOK); - + /* if not define RT_USING_HEAP, using to eliminate the warning */ (void)result; #endif @@ -247,4 +248,3 @@ int rtthread_startup(void) return 0; } #endif -#endif |
