fix: Rückgabewert von tls_os_mutex_create in UserMain prüfen

Schlägt die Mutex-Erstellung für s_lock fehl, wird jetzt "FATAL: cannot create app lock" ausgegeben und UserMain kehrt zurück, statt mit einem NULL-Mutex weiterzumachen und den App-Task zu starten.
This commit is contained in:
Michael Sauer
2026-09-11 20:53:34 +02:00
parent 4f270ad79b
commit 9ce5135489
+4 -1
View File
@@ -162,6 +162,9 @@ void UserMain(void)
printf("FATAL: unknown board %s\r\n", NINLIGHT_DEVICE_ID);
return;
}
tls_os_mutex_create(0, &s_lock);
if (tls_os_mutex_create(0, &s_lock) != TLS_OS_SUCCESS) {
printf("FATAL: cannot create app lock\r\n");
return;
}
tls_os_task_create(NULL, "nl_app", app_task, NULL, (u8 *)s_app_stack, sizeof(s_app_stack), NL_APP_PRIO, 0);
}