Merge #271 into sdk602patch0521 from refs/changes/271/head 272/target/1 273/target/1 274/target/1 275/target/1
author彭磊 <1624952103@qq.com>
Thu, 13 Jun 2024 06:14:10 +0000 (06:14 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Thu, 13 Jun 2024 06:14:10 +0000 (06:14 +0000)
优化蓝牙产测,添加ppg关闭led指令

* refs/changes/271/head: (1 commits squashed)

  - 优化蓝牙产测,添加ppg关闭led指令

Signed-off-by: aliyun6865282430 <1624952103@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/271
code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c
code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp
code/sdk/drivers/peripheral/ppg/service/ppg_service.h

index 0beb7e9..de9e3e3 100644 (file)
@@ -277,6 +277,8 @@ void ble_microhone_check_timer_callback(void)
 \r
     uapi_microhone_switch(0);\r
 \r
+    osTimerStop(g_ble_microhone_timer);\r
+    osTimerDelete(g_ble_microhone_timer);\r
     factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
             BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER,\r
             0x01,\r
@@ -290,7 +292,8 @@ void ble_spk_check_timer_callback(void)
     uint8_t send_data= 0;\r
 \r
     uapi_check_spk(0);\r
-\r
+    osTimerStop(g_ble_spk_timer);\r
+    osTimerDelete(g_ble_spk_timer);\r
     factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
             BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER,\r
             0x02,\r
@@ -809,7 +812,12 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                 //写入RTC\r
                 uint8_t send_data = 0x00;\r
 \r
-                set_system_time((char *)data);\r
+                uint32_t timestamp = (data[0] & 0XFF) << 24 | \r
+                                     (data[1] & 0XFF) << 16 | \r
+                                     (data[2] & 0XFF) << 8 | \r
+                                     (data[3] & 0XFF) << 0 ;\r
+                PRINT("rtc set time : %X \r\n",timestamp);\r
+                uaip_set_time_local(timestamp);\r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_RTC,\r
                         0x01,\r
@@ -1196,7 +1204,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
             {\r
                 //关闭所有LED\r
                 uint8_t send_data = 0x00;\r
-                send_ppg_cmd_msg("ledoff");\r
+                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_LED_OFF_MODE_TEST);\r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS,\r
                         0x02,\r
index 6fc1c96..9e53206 100644 (file)
@@ -2376,6 +2376,7 @@ bool hx3695_init(WORK_MODE_T mode)
         break;\r
 \r
     case FT_LED_OFF_MODE:\r
+        TYHX_LOG(" hx3695_init mode : FT_LED_OFF_MODE \n");\r
         hx3695_factroy_test(LED_OFF_TEST);\r
         break;\r
      \r
index 613a606..276527e 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-03-13 15:08:38
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-05-10 12:19:56
+ * @LastEditTime: 2024-06-13 10:16:15
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c
  * @Description: 
  * 
@@ -61,8 +61,7 @@ void ppg_send_cmd_to_driver(char* mode, uint8_t enable)
     } 
 
    
-    if (enable == 1) {
-
+    if (enable == 1 || md == FT_LED_OFF_MODE) {
         // ppg_service_running_stat = true;
         uapi_pm_control(PM_APP_WAKE_NEEDED);
         tyhx_poweron();
index fdbeae3..ac3d3cb 100644 (file)
@@ -329,8 +329,10 @@ static void ppg_service_check_task(void  *arg)
             cmd = "wear";
             enable = 1;
             wear_mode_state = 1;
-        }
-        else if (mail == PPG_SERVICE_CMD_TYPE_STOP_WEAR_MODE_TEST){
+        }else if (mail == PPG_SERVICE_CMD_TYPE_DO_LED_OFF_MODE_TEST){
+            cmd = "ledoff";
+            enable = 0;
+        }else if (mail == PPG_SERVICE_CMD_TYPE_STOP_WEAR_MODE_TEST){
             if (keep_in_wear_det_mod == 0) continue;
             cmd = "wear";
             enable = 0;
index 513c2ed..965e70d 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-03-27 09:07:00
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-04-22 10:43:36
+ * @LastEditTime: 2024-06-13 09:42:57
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/service/ppg_service.h
  * @Description: 
  * 
@@ -41,6 +41,7 @@ extern "C" {
 #define PPG_SERVICE_CMD_TYPE_STOP_SPO2_TEST 0x1F
 #define PPG_SERVICE_CMD_TYPE_DO_WEAR_MODE_TEST 0x20
 #define PPG_SERVICE_CMD_TYPE_STOP_WEAR_MODE_TEST 0x21
+#define PPG_SERVICE_CMD_TYPE_DO_LED_OFF_MODE_TEST 0x22
 
 errcode_t uapi_ppg_service_init(void);
 void uapi_ppg_service_deinit(void);