diff --git a/openrtx/src/threads.c b/openrtx/src/threads.c index 7796090e..6f9f4501 100644 --- a/openrtx/src/threads.c +++ b/openrtx/src/threads.c @@ -170,11 +170,11 @@ static void kbd_task(void *arg) // Reset flags and get current time long_press = false; send_event = false; - now = OSTimeGet(&os_err); // Lock display mutex and read keyboard status OSMutexPend(&display_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err); keys = kbd_getKeys(); OSMutexPost(&display_mutex, OS_OPT_POST_NONE, &os_err); + now = OSTimeGet(&os_err); // The key status has changed if(keys != prev_keys) {