kernel: Optimize display format for auto init when debugging

When RT_DEBUGING_AUTO_INIT is enabled, kenrel will add more
print message for auto init. However, the original format
easily causes the kernel printing and the init function printing
to be connected together, resulting in a confusing display
format.

For exmaple:
```
initialize lwip_system_initlwIP-2.0.3 initialized!
:0 done
```
Or
```
initialize sal_init[I/sal.skt] Socket Abstraction Layer initialize success.
:0 done
```

Solution: Add a carriage return to separate the kernel
printing and the init function printing.

After changing, the output will be:
```
initialize lwip_system_init
lwIP-2.0.3 initialized!
:0 done
```
Or
```
initialize sal_init
[I/sal.skt] Socket Abstraction Layer initialize success.
:0 done
```

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
This commit is contained in:
Chen Wang 2024-11-26 16:09:06 +08:00 committed by Meco Man
parent ca1d4e6dea
commit c4ba5ee068
1 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ void rt_components_board_init(void)
const struct rt_init_desc *desc; const struct rt_init_desc *desc;
for (desc = &__rt_init_desc_rti_board_start; desc < &__rt_init_desc_rti_board_end; desc ++) for (desc = &__rt_init_desc_rti_board_start; desc < &__rt_init_desc_rti_board_end; desc ++)
{ {
rt_kprintf("initialize %s", desc->fn_name); rt_kprintf("initialize %s\n", desc->fn_name);
result = desc->fn(); result = desc->fn();
rt_kprintf(":%d done\n", result); rt_kprintf(":%d done\n", result);
} }
@ -116,7 +116,7 @@ void rt_components_init(void)
rt_kprintf("do components initialization.\n"); rt_kprintf("do components initialization.\n");
for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++) for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++)
{ {
rt_kprintf("initialize %s", desc->fn_name); rt_kprintf("initialize %s\n", desc->fn_name);
result = desc->fn(); result = desc->fn();
rt_kprintf(":%d done\n", result); rt_kprintf(":%d done\n", result);
} }