From 213e2e30b66cee711f8e8f65899057bf28b074ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Thu, 15 Oct 2020 16:00:20 +0200 Subject: [PATCH] Increase control thread priority to -1 Set to lowest cooperative priority so that it cannot be interrupted by main or other threads (only by ISRs). --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4c156a1..00ce99b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -168,6 +168,7 @@ void control_thread() } // 2s delay for control thread as a safety feature: be able to re-flash before starting -K_THREAD_DEFINE(control_thread_id, 1024, control_thread, NULL, NULL, NULL, 2, 0, 2000); +// priority is set to -1 (=cooperative) to have higher priority than other threads incl. main +K_THREAD_DEFINE(control_thread_id, 1024, control_thread, NULL, NULL, NULL, -1, 0, 2000); #endif // UNIT_TEST