Fix deadlock issue on linux target

The keyboard thread was causing a deadlock with the ui thread,
now the keyboard thread is non-blocking.
This commit is contained in:
Niccolò Izzo 2021-01-15 22:09:11 +01:00
parent cb4b55d9a3
commit 827bc45794
3 changed files with 3 additions and 3 deletions

View File

@ -59,6 +59,6 @@ int main(void)
while(true)
{
// No low-frequency function at the moment
OSTaskSuspend(NULL, &os_err);
;
}
}

View File

@ -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);

View File

@ -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() */