From 9ce51354899d345032dbd1f24398755bb1137063 Mon Sep 17 00:00:00 2001 From: Michael Sauer Date: Fri, 11 Sep 2026 20:53:34 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20R=C3=BCckgabewert=20von=20tls=5Fos=5Fmut?= =?UTF-8?q?ex=5Fcreate=20in=20UserMain=20pr=C3=BCfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/app_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app_main.c b/src/app_main.c index 874a246..91ad5d4 100644 --- a/src/app_main.c +++ b/src/app_main.c @@ -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); }