From fe0a5a6d0343b811a87495b99a49e02cc6833a31 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Sun, 29 Sep 2024 21:29:25 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E6=8A=AC=E8=85=95=E4=BA=AE?= =?utf8?q?=E5=B1=8F=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../power_manager/src/actions/display_action.c | 3 ++- .../sdk/drivers/peripheral/utils/custom_cmd_service.c | 11 ++++++++--- code/sdk/drivers/peripheral/utils/custom_utils.c | 6 ++++++ code/sdk/drivers/peripheral/utils/custom_utils.h | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c index 6a7278575..c10e3951d 100755 --- a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c +++ b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c @@ -167,7 +167,8 @@ static uint32_t action_display_lcd_on() #endif if ((g_pms_lcd_on_first_flag == false) && (g_pms_dpu_ready == false)) { // touch_screen_resume();// open touch/ - post_func_to_graphic(touch_screen_resume); // open touch 太耗时,放到GraphicService里延迟执行,加快亮屏速度。 + if (touch_resume_in_cmd_queue() != 0) + post_func_to_graphic(touch_screen_resume); // open touch 太耗时,放到GraphicService里延迟执行,加快亮屏速度。 rotary_encoder_resume(); } #ifdef CONFIG_CLDO1PD_SUPPORT diff --git a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c index 8987dc0fa..854b1a6cf 100644 --- a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c +++ b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c @@ -55,16 +55,16 @@ static unsigned long g_custom_cmd_queue; static bool g_custom_cmd_queue_created = 0; static bool custom_cmd_service_running_stat = false; -void do_custom_cmd_service_check_msg(int cmd, void *params, int paramlen) +errcode_t do_custom_cmd_service_check_msg(int cmd, void *params, int paramlen) { int ret; - if (g_custom_cmd_queue_created == 0 ) return ; + if (g_custom_cmd_queue_created == 0 ) return ERRCODE_FAIL; // 检查参数长度是否合法 if (paramlen > sizeof(custom_cmd_cmd_t) - sizeof(uint8_t)) { PRINT("Error: 参数长度超过最大限制! \r\n"); - return; + return ERRCODE_FAIL; } custom_cmd_cmd_t mail = {0}; @@ -80,7 +80,9 @@ void do_custom_cmd_service_check_msg(int cmd, void *params, int paramlen) if (ret != OSAL_SUCCESS) { PRINT("Error custom_cmd Check MSG 0x%02X send failed! err=0x%x! \r\n", cmd, ret); + return ERRCODE_FAIL; } + return ERRCODE_SUCC; } static void custom_cmd_service_check_task(void const *arg) @@ -104,6 +106,9 @@ static void custom_cmd_service_check_task(void const *arg) // 根据邮件中的命令进行相应的处理 switch (mail.cmd) { + case CUSTOM_CMD_MSG_TYPE_TOUCH_RESUME: + touch_screen_resume(); + break; case CUSTOM_CMD_MSG_TYPE_ADD_CAT1VOTE: uapi_cat1_add_cat1_vote(); //中断会在此添加休眠投票,在收到cat1的消息后,会移除投票进入休眠。 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 2f236f782..19c272a83 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -3588,3 +3588,9 @@ void uapi_clean_sleep_flag(void) { uapi_delete_files(SLEEP_FLAG_PATH); } + + +errcode_t touch_resume_in_cmd_queue(void) +{ + return do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_TOUCH_RESUME,NULL,0); +} \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index db43ae516..a1068b425 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -217,6 +217,8 @@ uint32_t uapi_calendar_store_date(void); #define CUSTOM_CMD_MSG_CHECK_RES 0x0D #define CUSTOM_CMD_MSG_DOWNLOAD_RES 0x0E + +#define CUSTOM_CMD_MSG_TYPE_TOUCH_RESUME 0x0F typedef enum { BR_HFP_CONNECT=1, BR_HFP_DISCONNECT, @@ -228,7 +230,7 @@ typedef enum { } CUSTOM_CMD_MSG_BR_CONNECT_TYPE; errcode_t uapi_custom_cmd_service_init(void); -void do_custom_cmd_service_check_msg(int cmd, void *params, int paramlen); +errcode_t do_custom_cmd_service_check_msg(int cmd, void *params, int paramlen); int uapi_delete_files(const char *file_path); void uapi_restore_factory_setting(void); @@ -327,6 +329,8 @@ void set_drag_limit(uint8_t direction, uint16_t limit); */ uint16_t get_drag_limit(uint8_t direction); +errcode_t touch_resume_in_cmd_queue(void); + #include "custom_utilscpp.h" -- 2.17.1