summaryrefslogtreecommitdiff
path: root/components/init/components.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/init/components.c')
-rw-r--r--components/init/components.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/components/init/components.c b/components/init/components.c
index 83e13f22cd..44ff11361a 100644
--- a/components/init/components.c
+++ b/components/init/components.c
@@ -52,6 +52,16 @@ INIT_EXPORT(rti_end,"7");
void rt_components_board_init(void)
{
#ifndef _MSC_VER
+#if RT_DEBUG_INIT
+ int result;
+ const struct rt_init_desc *desc;
+ for (desc = &__rt_init_desc_rti_start; desc < &__rt_init_desc_rti_board_end; desc ++)
+ {
+ rt_kprintf("initialize %s", desc->fn_name);
+ result = desc->fn();
+ rt_kprintf(":%d done\n", result);
+ }
+#else
const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++)
@@ -59,6 +69,7 @@ void rt_components_board_init(void)
(*fn_ptr)();
}
#endif
+#endif
}
/**
@@ -67,12 +78,25 @@ void rt_components_board_init(void)
void rt_components_init(void)
{
#ifndef _MSC_VER
+#if RT_DEBUG_INIT
+ int result;
+ const struct rt_init_desc *desc;
+
+ rt_kprintf("do components intialization.\n");
+ for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++)
+ {
+ rt_kprintf("initialize %s", desc->fn_name);
+ result = desc->fn();
+ rt_kprintf(":%d done\n", result);
+ }
+#else
const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
{
(*fn_ptr)();
}
+#endif
#else
#ifdef RT_USING_MODULE
rt_system_module_init();