mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core/init: clean up !core_thread init path
This commit is contained in:
parent
ef0e3fb54e
commit
d39dc587f5
@ -90,6 +90,13 @@ static void *idle_thread(void *arg)
|
|||||||
|
|
||||||
void kernel_init(void)
|
void kernel_init(void)
|
||||||
{
|
{
|
||||||
|
if (!IS_USED(MODULE_CORE_THREAD)) {
|
||||||
|
/* RIOT without threads */
|
||||||
|
main_trampoline(NULL);
|
||||||
|
while (1) {}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
irq_disable();
|
irq_disable();
|
||||||
|
|
||||||
if (IS_USED(MODULE_CORE_IDLE_THREAD)) {
|
if (IS_USED(MODULE_CORE_IDLE_THREAD)) {
|
||||||
@ -99,19 +106,10 @@ void kernel_init(void)
|
|||||||
idle_thread, NULL, "idle");
|
idle_thread, NULL, "idle");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_USED(MODULE_CORE_THREAD)) {
|
thread_create(main_stack, sizeof(main_stack),
|
||||||
thread_create(main_stack, sizeof(main_stack),
|
THREAD_PRIORITY_MAIN,
|
||||||
THREAD_PRIORITY_MAIN,
|
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
|
||||||
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
|
main_trampoline, NULL, "main");
|
||||||
main_trampoline, NULL, "main");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* RIOT without threads */
|
|
||||||
irq_enable();
|
|
||||||
main_trampoline(NULL);
|
|
||||||
while (1) {}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cpu_switch_context_exit();
|
cpu_switch_context_exit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user