暂时关闭佩戴检测,解决系统不休眠问题 60/1 60/head 61/target/1 62/target/1 63/target/1
authorSnickerSun <snickersun@163.com>
Sun, 21 Apr 2024 15:52:37 +0000 (23:52 +0800)
committerSnickerSun <snickersun@163.com>
Sun, 21 Apr 2024 15:52:37 +0000 (23:52 +0800)
去除部分不必要的日志

code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp
code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp
code/sdk/drivers/peripheral/ppg/service/ppg_service.h
code/sdk/drivers/peripheral/utils/custom_cmd_service.c
code/sdk/drivers/peripheral/utils/custom_utils.c

index 32124d7..51186fd 100644 (file)
@@ -422,7 +422,7 @@ namespace OHOS
     {
         if (model_initialled == true)
         {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConfigModel::Init already done");
+            // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConfigModel::Init already done");
             return ;
         }
         /* -------------------------------- 1.加载json文件 -------------------------------- */
@@ -773,11 +773,11 @@ void initializeRaiseToWake(void)
     bool isOpen =  OHOS::ConfigModel::GetInstance()->GetRaiseToWake();
     if(isOpen == true)
     {
-        uapi_take_to_wake(1);
+        // uapi_take_to_wake(1);
     }
     else
     {
-        uapi_take_to_wake(0);
+        // uapi_take_to_wake(0);
     }
 }
 #ifdef __cplusplus
index 6e3a963..3d92932 100644 (file)
@@ -66,7 +66,13 @@ static unsigned long g_app_queue;
 static bool ppg_service_running_stat = false;
 
 static uint8_t wear_mode_state = 0;
+static uint8_t keep_in_wear_det_mod = 0; //持续坚持 佩戴检测模式
 
+
+void set_keep_in_wear_det_mode(uint8_t mod)
+{
+    keep_in_wear_det_mod = mod;
+}
 void CustomEventPublish(uint16_t topic, uint8_t *data , uint32_t size)
 {
     int32 ret;
@@ -278,6 +284,7 @@ static void ppg_service_check_task(void  *arg)
     uint32_t msgsize = (uint32_t)sizeof(PPG_CMD_TYPE_T);
 #ifdef PPG_HX3695
     hx3695_register_msg_callback(hx3695_msg_callback);//注册驱动回调
+    // ppg_send_cmd_to_driver("wear",0);
 #endif
     while (1) {
         ret = osal_msg_queue_read_copy(g_app_queue, (void *)&mail, &msgsize,
@@ -316,11 +323,13 @@ static void ppg_service_check_task(void  *arg)
             cmd = "graycard";
             enable = 1;
         }else if (mail == PPG_SERVICE_CMD_TYPE_DO_WEAR_MODE_TEST){
+            if (keep_in_wear_det_mod == 0) continue;;
             cmd = "wear";
             enable = 1;
             wear_mode_state = 1;
         }
         else if (mail == PPG_SERVICE_CMD_TYPE_STOP_WEAR_MODE_TEST){
+            if (keep_in_wear_det_mod == 0) continue;
             cmd = "wear";
             enable = 0;
             wear_mode_state = 0;
@@ -344,17 +353,21 @@ static void ppg_service_check_task(void  *arg)
         }
 #ifdef PPG_HX3695
        ppg_send_cmd_to_driver(cmd,enable);
+    if(enable == 1)
+        ppg_service_running_stat = true;
+    else
+        ppg_service_running_stat = false;
     if((strcmp(cmd, "wear") != 0) && (enable == 0))
     {
-        ppg_send_cmd_to_driver("wear",1);
-        wear_mode_state = 1;
-        ppg_service_running_stat = true;
+        if (keep_in_wear_det_mod == 1)
+        {
+            ppg_send_cmd_to_driver("wear",1);
+            wear_mode_state = 1;
+            ppg_service_running_stat = true;
+        }
     }
 #endif
-       if(enable == 1)
-            ppg_service_running_stat = true;
-        else
-            ppg_service_running_stat = false;
+
         
     }
 }
index 964edae..d76187e 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-03-27 09:07:00
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-04-10 11:23:48
+ * @LastEditors: SnickerSun snickersun@163.com
+ * @LastEditTime: 2024-04-21 22:49:47
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/service/ppg_service.h
  * @Description: 
  * 
@@ -81,6 +81,9 @@ typedef struct {
 
 void CustomEventPublish(uint16_t topic, uint8_t *data , uint32_t size);
 
+//设置佩戴检测模式
+void set_keep_in_wear_det_mode(uint8_t mod);
+
 #ifdef __cplusplus
 #if __cplusplus
 }
index 53b7f04..73c0a3f 100644 (file)
@@ -34,7 +34,7 @@
 typedef struct
 {
     uint8_t cmd;
-    uint8_t data[50];
+    uint8_t data[5];
 } custom_cmd_cmd_t;
 /***
  * 其他cmd在Header里定义,对外开放
index 5721adf..8ed2104 100644 (file)
@@ -22,7 +22,7 @@
 #include "pinctrl.h"
 #include "errcode.h"
 #include "power_display_service.h"
-#include "config/include/ConfigModelC.h"
+// #include "config/include/ConfigModelC.h"
 #include "soundandvibration/include/SoundAndVibrationVolumeSettingC.h"
 
 #define SUPPORT_NV