优化抬腕亮屏速度 1063/1 1063/head
authorSnickerSun <snickersun@163.com>
Sun, 29 Sep 2024 13:29:25 +0000 (21:29 +0800)
committerSnickerSun <snickersun@163.com>
Sun, 29 Sep 2024 13:29:25 +0000 (21:29 +0800)
code/sdk/application/wearable/service/power_manager/src/actions/display_action.c
code/sdk/drivers/peripheral/utils/custom_cmd_service.c
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 6a72785..c10e395 100755 (executable)
@@ -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
index 8987dc0..854b1a6 100644 (file)
@@ -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的消息后,会移除投票进入休眠。
index 2f236f7..19c272a 100644 (file)
@@ -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
index db43ae5..a1068b4 100644 (file)
@@ -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"