From 591d5e9d4ec088fc95f849168f95634a34c8e112 Mon Sep 17 00:00:00 2001 From: bkleiner Date: Sun, 19 Feb 2023 17:56:23 +0100 Subject: [PATCH] fix rbtn lvgl mutex lock --- src/core/input_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/input_device.c b/src/core/input_device.c index 8d7a74ed..436554eb 100644 --- a/src/core/input_device.c +++ b/src/core/input_device.c @@ -245,11 +245,11 @@ static void btn_click(void) // short press enter key } static void rbtn_click0(bool is_short) { + // lvgl mutex is already locked either via lv_timer or manually bellow + switch (g_menu_op) { case OPLEVEL_SUBMENU: - pthread_mutex_lock(&lvgl_mutex); submenu_right_button(is_short); - pthread_mutex_unlock(&lvgl_mutex); break; case OPLEVEL_VIDEO: @@ -284,7 +284,9 @@ void rbtn_click(bool is_short) { } } } else { + pthread_mutex_lock(&lvgl_mutex); rbtn_click0(false); + pthread_mutex_unlock(&lvgl_mutex); } }