From 827bc45794f8ab62391d00c6d867ea13181aaf6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Izzo?= Date: Fri, 15 Jan 2021 22:09:11 +0100 Subject: [PATCH] Fix deadlock issue on linux target The keyboard thread was causing a deadlock with the ui thread, now the keyboard thread is non-blocking. --- openrtx/src/main.c | 2 +- openrtx/src/threads.c | 2 +- rtos/uC-OS3/Cfg/os_cfg_x64.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openrtx/src/main.c b/openrtx/src/main.c index 65426533..d51bb76d 100644 --- a/openrtx/src/main.c +++ b/openrtx/src/main.c @@ -59,6 +59,6 @@ int main(void) while(true) { // No low-frequency function at the moment - OSTaskSuspend(NULL, &os_err); + ; } } diff --git a/openrtx/src/threads.c b/openrtx/src/threads.c index a3f04ab3..cb3f5fa7 100644 --- a/openrtx/src/threads.c +++ b/openrtx/src/threads.c @@ -173,7 +173,7 @@ static void kbd_task(void *arg) long_press = false; send_event = false; // Lock display mutex and read keyboard status - OSMutexPend(&display_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err); + OSMutexPend(&display_mutex, 0u, OS_OPT_PEND_NON_BLOCKING, 0u, &os_err); keys = kbd_getKeys(); OSMutexPost(&display_mutex, OS_OPT_POST_NONE, &os_err); now = OSTimeGet(&os_err); diff --git a/rtos/uC-OS3/Cfg/os_cfg_x64.h b/rtos/uC-OS3/Cfg/os_cfg_x64.h index 28e7557d..6164f07d 100644 --- a/rtos/uC-OS3/Cfg/os_cfg_x64.h +++ b/rtos/uC-OS3/Cfg/os_cfg_x64.h @@ -78,7 +78,7 @@ /* -------------------------- TASK MANAGEMENT -------------------------- */ -#define OS_CFG_STAT_TASK_EN 1u /* Enable (1) or Disable (0) the statistics task */ +#define OS_CFG_STAT_TASK_EN 0u /* Enable (1) or Disable (0) the statistics task */ #define OS_CFG_STAT_TASK_STK_CHK_EN 1u /* Check task stacks from the statistic task */ #define OS_CFG_TASK_CHANGE_PRIO_EN 1u /* Include code for OSTaskChangePrio() */