summaryrefslogtreecommitdiff
path: root/src/components.c
diff options
context:
space:
mode:
authoryangjie11 <[email protected]>2020-11-18 09:56:35 +0800
committerGitHub <[email protected]>2020-11-18 09:56:35 +0800
commitd4a682e8d97fa131e5a8d795f8c5451d55cdd5b0 (patch)
tree4773b40cb012475c5daf74bfd55707e141477669 /src/components.c
parent2b98f4720c827ae1850df78299f6b273d568c8c7 (diff)
parent2ef3c9d861f55253620996a94831a4be31ca6620 (diff)
Merge pull request #3 from RT-Thread/master
sync
Diffstat (limited to 'src/components.c')
-rw-r--r--src/components.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/components.c b/src/components.c
index d77ef8300f..e7824b65ef 100644
--- a/src/components.c
+++ b/src/components.c
@@ -92,7 +92,7 @@ void rt_components_board_init(void)
rt_kprintf(":%d done\n", result);
}
#else
- const init_fn_t *fn_ptr;
+ volatile const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_board_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++)
{
@@ -118,7 +118,7 @@ void rt_components_init(void)
rt_kprintf(":%d done\n", result);
}
#else
- const init_fn_t *fn_ptr;
+ volatile const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
{
@@ -126,6 +126,7 @@ void rt_components_init(void)
}
#endif
}
+#endif /* RT_USING_COMPONENTS_INIT */
#ifdef RT_USING_USER_MAIN
@@ -138,7 +139,6 @@ extern int $Super$$main(void);
/* re-define main function */
int $Sub$$main(void)
{
- rt_hw_interrupt_disable();
rtthread_startup();
return 0;
}
@@ -150,16 +150,13 @@ int __low_level_init(void)
{
// call IAR table copy function.
__iar_data_init3();
- rt_hw_interrupt_disable();
rtthread_startup();
return 0;
}
#elif defined(__GNUC__)
-extern int main(void);
/* Add -eentry to arm-none-eabi-gcc argument */
int entry(void)
{
- rt_hw_interrupt_disable();
rtthread_startup();
return 0;
}
@@ -178,9 +175,10 @@ 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
#ifdef RT_USING_SMP
rt_hw_secondary_cpu_up();
#endif
@@ -207,7 +205,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
@@ -258,4 +256,3 @@ int rtthread_startup(void)
return 0;
}
#endif
-#endif