1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core: cleanup kernel_init.c

This commit is contained in:
Kaspar Schleiser 2020-01-31 10:12:49 +01:00
parent 57db6b7313
commit dec0870b4e

View File

@ -37,9 +37,10 @@
#endif
extern int main(void);
static void *main_trampoline(void *arg)
{
(void) arg;
(void)arg;
#ifdef MODULE_AUTO_INIT
auto_init();
@ -48,12 +49,13 @@ static void *main_trampoline(void *arg)
LOG_INFO("main(): This is RIOT! (Version: " RIOT_VERSION ")\n");
main();
return NULL;
}
static void *idle_thread(void *arg)
{
(void) arg;
(void)arg;
while (1) {
pm_set_lowest();
@ -62,25 +64,22 @@ static void *idle_thread(void *arg)
return NULL;
}
const char *main_name = "main";
const char *idle_name = "idle";
static char main_stack[THREAD_STACKSIZE_MAIN];
static char idle_stack[THREAD_STACKSIZE_IDLE];
void kernel_init(void)
{
(void) irq_disable();
irq_disable();
thread_create(idle_stack, sizeof(idle_stack),
THREAD_PRIORITY_IDLE,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
idle_thread, NULL, idle_name);
THREAD_PRIORITY_IDLE,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
idle_thread, NULL, "idle");
thread_create(main_stack, sizeof(main_stack),
THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
main_trampoline, NULL, main_name);
THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
main_trampoline, NULL, "main");
cpu_switch_context_exit();
}