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:
+4
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user