aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/rt/src/chsys.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c
index 21a87a8a7..82a9e78d6 100644
--- a/os/rt/src/chsys.c
+++ b/os/rt/src/chsys.c
@@ -125,7 +125,11 @@ void chSysInit(void) {
#if CH_CFG_NO_IDLE_THREAD == FALSE
/* Now this instructions flow becomes the main thread.*/
+#if CH_CFG_USE_REGISTRY == TRUE
+ currp = _thread_init(&ch.mainthread, (const char *)&ch_debug, NORMALPRIO);
+#else
currp = _thread_init(&ch.mainthread, "main", NORMALPRIO);
+#endif
#else
/* Now this instructions flow becomes the idle thread.*/
currp = _thread_init(&ch.mainthread, "idle", IDLEPRIO);
@@ -149,12 +153,6 @@ void chSysInit(void) {
/* It is alive now.*/
chSysEnable();
-#if CH_CFG_USE_REGISTRY == TRUE
- /* Note, &ch_debug points to the string "main" if the registry is
- active.*/
- chRegSetThreadName((const char *)&ch_debug);
-#endif
-
#if CH_CFG_NO_IDLE_THREAD == FALSE
{
static const thread_descriptor_t idle_descriptor = {