Merge #300 into sdk602patch0521 from refs/changes/300/head
author彭磊 <1624952103@qq.com>
Mon, 17 Jun 2024 12:25:45 +0000 (12:25 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Mon, 17 Jun 2024 12:25:45 +0000 (12:25 +0000)
Code review from 彭磊

* refs/changes/300/head: (10 commits squashed)

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

  - Merge branch &#39;sdk602patch0521&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521

  - 蓝牙产测添加NTC测试指令

  - Merge branch &#39;sdk602patch0521&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521

  - 添加开机动画,优化蓝牙产测,优化久坐提醒设置,添加efuse读写测试接口

  - 补交

  - Merge branch &#39;sdk602patch0521&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521

  - 优化蓝牙产测与开机动画

  - Merge branch &#39;sdk602patch0521&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521

  - 补交

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/300
43 files changed:
code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c
code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c
code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24000.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24001.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24002.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24003.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24004.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24005.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24006.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24007.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24008.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24009.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24010.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24011.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24012.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24013.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24014.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24015.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24016.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24017.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24018.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24019.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24020.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24021.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24022.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24023.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24024.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24025.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24026.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24027.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24028.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24029.bin [new file with mode: 0644]
code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h
code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.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
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h
code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c
code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp

index f2e077c..4160dcc 100755 (executable)
@@ -61,13 +61,16 @@ void ohos_startup()
 #if defined(CONFIG_OTA_UPDATE_SUPPORT) && defined(ENABLE_UIKIT)
  if  (upg_check_upgrade_need_upgrade())
  {
+    boot_animation_init();
     ShowGraphicOTALogo();
  }else{
+    boot_animation_init();
     ShowGraphicLogo();
  }
 #else
 
 #ifdef ENABLE_UIKIT
+    boot_animation_init();
     ShowGraphicLogo();
 #endif
 
index ce293ef..64073c0 100644 (file)
@@ -1,3 +1,13 @@
+/*\r
+ * @Author: penglei 1624952103@qq.com\r
+ * @Date: 2024-06-17 14:31:08\r
+ * @LastEditors: penglei 1624952103@qq.com\r
+ * @LastEditTime: 2024-06-17 17:51:27\r
+ * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c\r
+ * @Description: \r
+ * \r
+ * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. \r
+ */\r
 /*\r
  * Copyright (c) @CompanyNameMagicTag 2022. All rights reserved.\r
  * Description: BT HID Service Server Module.\r
@@ -65,18 +75,18 @@ static int factorytest_mode_flag = 0;
 \r
 ble_aging_t aging_t;\r
 \r
-static osTimerId_t g_ble_vibrator_timer;\r
+static osTimerId_t g_ble_vibrator_timer = NULL;\r
 \r
-static osTimerId_t g_ble_acc_timer;\r
+static osTimerId_t g_ble_acc_timer = NULL;\r
 \r
-static osTimerId_t g_ble_hrs_timer;\r
-static osTimerId_t g_ble_spo2_timer;\r
-\r
-static osTimerId_t g_ble_microhone_timer;\r
-static osTimerId_t g_ble_spk_timer;\r
+static osTimerId_t g_ble_microhone_timer = NULL;\r
+static osTimerId_t g_ble_spk_timer = NULL;\r
 \r
 static uint32_t aging_time = 0;\r
 \r
+static uint8_t pwr_button_result = 0;\r
+static uint8_t func_button_result = 1;\r
+\r
 static int CRC16_XMODEM(uint8_t *bytes,uint16_t length) {\r
     int crc = 0x0000;          // initial value\r
     int polynomial = 0x1021;\r
@@ -127,64 +137,28 @@ errcode_t factorytest_protocol_replymsg(uint8_t mode, uint8_t submode,uint8_t te
 \r
 static void pwr_button_callback_press(void)\r
 {\r
-    uint8_t send_data = 1;\r
-\r
-    factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
-            0x02,\r
-            &send_data,\r
-            1);\r
+    pwr_button_result = 1;\r
 }\r
 static void pwr_button_callback_click_2(void)\r
 {\r
-    uint8_t send_data = 3;\r
-\r
-    factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
-            0x02,\r
-            &send_data,\r
-            1);\r
+    pwr_button_result = 3;\r
 }\r
 static void pwr_button_callback_long_press_2s(void)\r
 {\r
-    uint8_t send_data = 2;\r
-\r
-    factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
-            0x02,\r
-            &send_data,\r
-            1);\r
+    pwr_button_result = 2;\r
 }\r
 \r
 static void func_button_callback_press(void)\r
 {\r
-    uint8_t send_data = 1;\r
-\r
-    factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
-            0x03,\r
-            &send_data,\r
-            1);\r
+    func_button_result = 1;\r
 }\r
 static void func_button_callback_click_2(void)\r
 {\r
-    uint8_t send_data = 3;\r
-\r
-    factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
-            0x03,\r
-            &send_data,\r
-            1);\r
+    func_button_result = 3;\r
 }\r
 static void func_button_callback_long_press_2s(void)\r
 {\r
-    uint8_t send_data = 2;\r
-\r
-    factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-            BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
-            0x03,\r
-            &send_data,\r
-            1);\r
+    func_button_result = 2;\r
 }\r
 \r
 void ble_vibrator_check_timer_callback(void)\r
@@ -204,77 +178,9 @@ void ble_acc_check_timer_callback(void)
             6);\r
 }\r
 \r
-\r
-void ble_hrs_check_timer_callback(void)\r
-{\r
-    uint8_t databuf[4] = {0};\r
-    int32_t ppg_buf;\r
-    uint8_t i;\r
-    if(ble_hrs_flag == 1)\r
-    {\r
-        ble_hrs_flag = 0;\r
-        osTimerStop(g_ble_hrs_timer);\r
-        osTimerDelete(g_ble_hrs_timer);\r
-        send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST);\r
-        return;\r
-    }\r
-\r
-    if(ble_hrs_data > 10000)\r
-    {\r
-        ppg_buf = ble_hrs_data;\r
-\r
-        databuf[0] = (uint8_t)((ppg_buf & 0xFF000000) >> 24);\r
-        databuf[1] = (uint8_t)((ppg_buf & 0x00FF0000) >> 16);\r
-        databuf[2] = (uint8_t)((ppg_buf & 0x0000FF00) >> 8);\r
-        databuf[3] = (uint8_t)((ppg_buf & 0x000000FF) >> 0);\r
-\r
-        PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]);\r
-\r
-        factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-                        BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS,\r
-                        0x03,\r
-                        databuf,\r
-                        4);\r
-    }\r
-\r
-}\r
-\r
-void ble_spo2_check_timer_callback(void)\r
-{\r
-    uint8_t databuf[4] = {0};\r
-    int32_t red_buf;\r
-\r
-    if(ble_spo2_flag == 1)\r
-    {\r
-        ble_spo2_flag = 0;\r
-        osTimerStop(g_ble_spo2_timer);\r
-        osTimerDelete(g_ble_spo2_timer);\r
-        send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_SPO2_TEST);\r
-        return;\r
-    }\r
-\r
-    if(ble_spo2_data > 10000)\r
-    {\r
-        red_buf = ble_spo2_data;\r
-\r
-        databuf[0] = (uint8_t)((red_buf & 0xFF000000) >> 24);\r
-        databuf[1] = (uint8_t)((red_buf & 0x00FF0000) >> 16);\r
-        databuf[2] = (uint8_t)((red_buf & 0x0000FF00) >> 8);\r
-        databuf[3] = (uint8_t)((red_buf & 0x000000FF) >> 0);\r
-\r
-        PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]);\r
-\r
-        factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
-                        BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS,\r
-                        0x04,\r
-                        databuf,\r
-                        4);\r
-    }\r
-\r
-}\r
-\r
 void ble_microhone_check_timer_callback(void)\r
 {\r
+    PRINT("ble_microhone_check_timer_callback \r\n");\r
     uint8_t send_data= 0;\r
 \r
     uapi_microhone_switch(0);\r
@@ -777,7 +683,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                         1);\r
             } else if(testitem == 0x02)\r
             {\r
-                //查询电源键测试结果\r
+                //开启电源键测试\r
                 uint8_t send_data = 0;\r
 \r
                 uapi_button_register_event_cb(pwr_button_callback_press, 1);\r
@@ -791,7 +697,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                         1);\r
             } else if(testitem == 0x03)\r
             {\r
-                //查询功能键测试结果\r
+                //开启功能键测试\r
                 uint8_t send_data = 0;\r
 \r
                 uapi_button_register_event_cb(func_button_callback_press, 24);\r
@@ -803,6 +709,26 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                         0x03,\r
                         &send_data,\r
                         1);\r
+            } else if(testitem == 0x04)\r
+            {\r
+                //查询电源键测试结果\r
+                uint8_t send_data = pwr_button_result;\r
+\r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                        BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
+                        0x04,\r
+                        &send_data,\r
+                        1);\r
+            } else if(testitem == 0x05)\r
+            {\r
+                //查询功能键测试结果\r
+                uint8_t send_data = func_button_result;\r
+\r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                        BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY,\r
+                        0x05,\r
+                        &send_data,\r
+                        1);\r
             }\r
 \r
             break;\r
@@ -1043,7 +969,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                 //LCD显示颜色\r
                 uint8_t send_data = 0x00;\r
                 char *color_buf[5] ={"0Xffff0000","0xff00ff00","0xff0000ff","0xffffffff","0xff000000"};\r
-                ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);\r
+                ScreenAlwaysOnCtr(1);\r
                 switch (*data)\r
                 {\r
                     case 1:\r
@@ -1242,16 +1168,44 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
             } else if(testitem == 0x03)\r
             {\r
                 //打开心率检测\r
-                g_ble_hrs_timer = osTimerNew((osTimerFunc_t)ble_hrs_check_timer_callback, osTimerPeriodic, NULL, NULL);\r
-                osTimerStart(g_ble_hrs_timer,400);\r
-                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_PPG_TEST);\r
+                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_SINGLE_CHECK_MODE_TEST);\r
+                FT_RESULTS_t ft_result = hx3695_factroy_test(SINGLE_CHECK_TEST);\r
+                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST);\r
+                uint8_t databuf[4] = {0};\r
+\r
+                databuf[0] = (uint8_t)((ft_result.gr_data_final & 0xFF000000) >> 24);\r
+                databuf[1] = (uint8_t)((ft_result.gr_data_final & 0x00FF0000) >> 16);\r
+                databuf[2] = (uint8_t)((ft_result.gr_data_final & 0x0000FF00) >> 8);\r
+                databuf[3] = (uint8_t)((ft_result.gr_data_final & 0x000000FF) >> 0);\r
+\r
+            PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]);\r
+\r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                                    BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS,\r
+                                    0x03,\r
+                                    databuf,\r
+                                    4);\r
 \r
             } else if(testitem == 0x04)\r
             {\r
                 //打开血氧检测\r
-                g_ble_spo2_timer = osTimerNew((osTimerFunc_t)ble_spo2_check_timer_callback, osTimerPeriodic, NULL, NULL);\r
-                osTimerStart(g_ble_spo2_timer,400);\r
-                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_SPO2_TEST);\r
+                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_SINGLE_CHECK_MODE_TEST);\r
+                FT_RESULTS_t ft_result = hx3695_factroy_test(SINGLE_CHECK_TEST);\r
+                send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST);\r
+                uint8_t databuf[4] = {0};\r
+\r
+                databuf[0] = (uint8_t)((ft_result.red_data_final & 0xFF000000) >> 24);\r
+                databuf[1] = (uint8_t)((ft_result.red_data_final & 0x00FF0000) >> 16);\r
+                databuf[2] = (uint8_t)((ft_result.red_data_final & 0x0000FF00) >> 8);\r
+                databuf[3] = (uint8_t)((ft_result.red_data_final & 0x000000FF) >> 0);\r
+\r
+                PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]);\r
+\r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                                    BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS,\r
+                                    0x04,\r
+                                    databuf,\r
+                                    4);\r
 \r
             } else if(testitem == 0x05)\r
             {\r
@@ -1512,9 +1466,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                 uint8_t send_data[2] = {0};\r
                 uint16_t len = sizeof(send_data);\r
 \r
-                cat1_getsignal();\r
-                msleep(1000);\r
-                send_data[1]=uapi_dev_runtime_get_cat1_simstat();\r
+                send_data[1] = uapi_dev_runtime_get_cat1_simstat();\r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1,\r
                         0x03,\r
@@ -1525,9 +1477,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                 //查看信号强度\r
                 uint8_t send_data[2] = {0};\r
 \r
-                cat1_getsignal();\r
-                msleep(1000);\r
-                send_data[1]=uapi_dev_runtime_get_cat1_signal();\r
+                send_data[1] = uapi_dev_runtime_get_cat1_signal();\r
 \r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1,\r
@@ -1537,19 +1487,18 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
             } else if(testitem == 0x05)\r
             {\r
                 //查看网络类型\r
-                uint8_t send_data = 0x00;\r
+                uint8_t send_data[2] = {0};\r
 \r
                 cat1_getsignal();\r
                 msleep(1000);\r
  \r
-             \r
-                PRINT("send_buf : %s \r\n",uapi_dev_runtime_get_cat1_operator());\r
-                \r
+                send_data[1] = uapi_dev_runtime_get_cat1_networtype();\r
+                 \r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1,\r
                         0x05,\r
-                        (uint8_t *)uapi_dev_runtime_get_cat1_operator(),\r
-                        strlen(uapi_dev_runtime_get_cat1_operator()));\r
+                        send_data,\r
+                        2);\r
             } else if(testitem == 0x06)\r
             {\r
                 //拨打电话\r
@@ -1627,16 +1576,16 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
             if(testitem == 0x01)\r
             {\r
                 //开始录音\r
-                g_ble_microhone_timer = osTimerNew((osTimerFunc_t)ble_microhone_check_timer_callback, osTimerPeriodic, NULL, NULL);\r
-                osTimerStart(g_ble_microhone_timer,5000);\r
                 uapi_microhone_switch(1);\r
+                g_ble_microhone_timer = osTimerNew((osTimerFunc_t)ble_microhone_check_timer_callback, osTimerPeriodic, NULL, NULL);\r
+                osStatus_t ret = osTimerStart(g_ble_microhone_timer,5000);\r
 \r
             } else if(testitem == 0x02)\r
             {\r
                 //播放录音\r
-                g_ble_microhone_timer = osTimerNew((osTimerFunc_t)ble_spk_check_timer_callback, osTimerPeriodic, NULL, NULL);\r
-                osTimerStart(g_ble_spk_timer,5000);\r
                 uapi_check_spk(1);\r
+                g_ble_spk_timer = osTimerNew((osTimerFunc_t)ble_spk_check_timer_callback, osTimerPeriodic, NULL, NULL);\r
+                osTimerStart(g_ble_spk_timer,5000);\r
             }\r
             break;\r
 \r
index 47cc3f5..ab2474c 100644 (file)
@@ -91,12 +91,13 @@ extern "C" {
 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_EXTRAM  0x19
 //软件测试 子模式ID  CAT1
 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1  0x1A
+//软件测试 子模式ID  SPEAKER
+#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER  0x1B
 //软件测试 子模式ID  通讯录
 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CONTACTS  0x30
 //软件测试 子模式ID  支付宝
 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ALIPAY  0x31
-//软件测试 子模式ID  SPEAKER
-#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER  0x32
+
 /**
  * 
  * encode cmd msg string and send to ble
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24000.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24000.bin
new file mode 100644 (file)
index 0000000..df0fd91
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b2e8929ab8b4d144647aba11d6050696d479dd477dbfd13767c1722c383bfdba
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24001.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24001.bin
new file mode 100644 (file)
index 0000000..63c9dd2
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6fc36ab917be00c9a2dcb673a4fdc05198bedc304fae2aea092f7cadec8ff8c1
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24002.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24002.bin
new file mode 100644 (file)
index 0000000..3fc424b
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3a0fec6de7599bae0be5ad991205ae46def1eed8b3e31d0e0c0d8ba1baaa9377
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24003.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24003.bin
new file mode 100644 (file)
index 0000000..b7f8786
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77318b7c30dc165ad3446704f735074c9249cb9af532175bbc5fbe50a22346e0
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24004.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24004.bin
new file mode 100644 (file)
index 0000000..495ba59
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2556df837668605afd33e405fba9fccf0064c11406a8a020cb6dba182ffd45d8
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24005.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24005.bin
new file mode 100644 (file)
index 0000000..ffdcfc3
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7fe3d6d01331bce80f744a20cf2a7a511a176491eeebe685232debbc59a60513
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24006.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24006.bin
new file mode 100644 (file)
index 0000000..26ae63c
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:231dc28ce86dd38fd832dfb4075cb6429474a09b189c08aeb0f251e58b4dee18
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24007.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24007.bin
new file mode 100644 (file)
index 0000000..34cecf4
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b1311d92b96c2ccd10e62ee6fcd20a2106f45dcc79b47b64ecc2060215037c37
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24008.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24008.bin
new file mode 100644 (file)
index 0000000..eba3757
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a57186043db8d9a469a6ac0ab5ce11857be7a70e3904e0d7cfba49949fd7090f
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24009.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24009.bin
new file mode 100644 (file)
index 0000000..9190647
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4a0abcac99fd87c447d584b1e678f806a72aa14a7b09d4019e0ba31bb03bc4c4
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24010.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24010.bin
new file mode 100644 (file)
index 0000000..0dcae4c
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c33cd26ae9f3e719a1b3c53c9f0695b95578bb050990fac51ea0acf04a455963
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24011.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24011.bin
new file mode 100644 (file)
index 0000000..5a71e53
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7b6fdd69730f4e9184be64e3c6e4da276e9fdaa5f918fb67110a932c18e74472
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24012.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24012.bin
new file mode 100644 (file)
index 0000000..563ffbb
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4db4068b89635fc810db382dd46ec6cfac090a0c54b6a490a68a224543a84fa6
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24013.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24013.bin
new file mode 100644 (file)
index 0000000..782884b
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:616669a7f5854eff91afb479443b97de8f3b95aec06c4c881962411857fb701c
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24014.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24014.bin
new file mode 100644 (file)
index 0000000..6116b80
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4341fb382647fe2cba3f9a7ada27726f1d1d8ce866977c4d97baf8b568a45308
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24015.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24015.bin
new file mode 100644 (file)
index 0000000..18cffae
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3181ea3fefff911e91484480ba7d60fa055c8ca97dbda6e34c9f0961e2a77cc0
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24016.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24016.bin
new file mode 100644 (file)
index 0000000..77f6c1a
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ee68b707a3ee930326b03a51e6ce2e0c46504e16174e02be590bf06f39b93c0c
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24017.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24017.bin
new file mode 100644 (file)
index 0000000..0e326b7
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:21013815879cb7652fe1dfc75a656ccc8b50d74c7f82f5e477743c4bdfa9c4b1
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24018.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24018.bin
new file mode 100644 (file)
index 0000000..4ff0ab1
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f235044b9ea03e41a467979b11a2a5d681ae8af1aa0b19e3ef4ec74c3ab0194b
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24019.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24019.bin
new file mode 100644 (file)
index 0000000..aa6ca33
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bee64e87ce7421f84f37bdc0a54a2009ea27ea5c9b5eae60e43a878e290ab471
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24020.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24020.bin
new file mode 100644 (file)
index 0000000..f36a6e1
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d86a0bfb57914c33d7d4ed3376facefe1746ff0b795e9e2f3dba01ab2e1dd9de
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24021.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24021.bin
new file mode 100644 (file)
index 0000000..779c4d1
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1b6b27c9ced02c6c7a8f7112fd87e889dbacd35538f5ca36552ce66502708239
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24022.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24022.bin
new file mode 100644 (file)
index 0000000..76a8f36
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:192c19c211c22699acccf68cf7953da115ed0ec1fdef07f08ae01dc517165186
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24023.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24023.bin
new file mode 100644 (file)
index 0000000..d1e932c
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4dd8807e244acdbf9211cba60fdf703b71728e0555656fc4f6893e4106c193f
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24024.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24024.bin
new file mode 100644 (file)
index 0000000..78aab23
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e55bafd8ed030183ad33075731538556e918d5fbbf6496551725125256cd880
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24025.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24025.bin
new file mode 100644 (file)
index 0000000..fc2a0ae
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e55e76d745e793c47c95f49b9156f6719af14b664285a762cf243bcbb33c2ffa
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24026.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24026.bin
new file mode 100644 (file)
index 0000000..7ac4fe0
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4cdec70803bcf05c5c7d792f102baf0f320e8c2aee84aa7d55f4dd2586f3250d
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24027.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24027.bin
new file mode 100644 (file)
index 0000000..d04cbd2
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5308e5feca09ca15036164a04543287b350a02186e4681299394fed681ac0dca
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24028.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24028.bin
new file mode 100644 (file)
index 0000000..8f65249
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4505667567257525d90db975552c8ae2e9757e606025497df6878f2e3dd99dd
+size 146040
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24029.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24029.bin
new file mode 100644 (file)
index 0000000..4fb68c2
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e08795fdde6362abb0f7aa9bac7a6587cdf7d79ee73dd5284a7c2990d5c15567
+size 146040
index 88a353e..cc96fc6 100644 (file)
@@ -528,6 +528,7 @@ int get_distance_data(void );
 void cywee_get_chipinfo(char *databuf,uint8_t len);
 void cywee_get_acc_switch(uint8_t cmd);
 void cywee_set_sedentary_interval(int time);
+
 extern uint8_t hrs_mode_state;
 
 #pragma pack()
index d0b3fed..55846fa 100644 (file)
@@ -96,6 +96,7 @@ int mmc5603_start(void)
        {       \r
                for(i=0;i<4;i++)\r
                {\r
+                       PRINT("saveData[%d] : %f \r\n",i,saveData[i]);\r
                        mag_hmm[i] = saveData[i]; \r
                }\r
        }\r
@@ -273,6 +274,8 @@ int SavePara(float *p)
 \r
 int SavePara_infile(float *p,uint32_t len)\r
 {      \r
+       for(int i = 0; i < len ; i++)\r
+               PRINT("p[%d] : %f \r\n",i,p[i]);\r
        FILE * fp = fopen(MMC_DATA_PATH,"wb");\r
        int ret = 0;\r
     if(fp==NULL)\r
index 9e53206..a2763bc 100644 (file)
@@ -2724,14 +2724,6 @@ void hx3695_hrs_ppg_Int_handle(void)
         return;\r
     }\r
 \r
-  for(ii = 0; ii < hrs_s_dat.count; ii++)\r
-    {\r
-      if(PPG_buf[ii] > 10000)\r
-      {\r
-          ble_hrs_data = PPG_buf[ii];\r
-      }\r
-    }\r
-               \r
 #ifndef GSEN_40MS_TIMMER\r
     //readFifoByHrsModule();\r
 #endif\r
@@ -2781,6 +2773,10 @@ void hx3695_hrs_ppg_Int_handle(void)
               gsen_fifo_y_send[ii] = gsensordata[ii].y * 2048;\r
               gsen_fifo_z_send[ii] = gsensordata[ii].z * 2048;\r
           }\r
+\r
+          if(abs(PPG_buf[ii]) > 10000)\r
+            ble_hrs_data = abs(PPG_buf[ii]);\r
+\r
           //PRINT("hxdata:%d/%d %d %d %.3f %.3f %.3f %d\r\n" ,1+ii,*count,PPG_buf[ii],ir_buf[0],gsen_fifo_x_send[ii],gsen_fifo_y_send[ii],gsen_fifo_z_send[ii],ppg_s_data.green_cur);\r
           PRINT("hxdata:%d/%d %d %d %d %d %d %d\r\n" ,1+ii,*count,PPG_buf[ii],ir_buf[0],gsen_fifo_x_send[ii],gsen_fifo_y_send[ii],gsen_fifo_z_send[ii],ppg_s_data.green_cur);\r
 \r
@@ -3210,16 +3206,7 @@ void hx3695_spo2_ppg_Int_handle(void)
     {\r
         return;\r
     }\r
-               \r
-      for(ii = 0; ii < hrs_s_dat.count; ii++)\r
-    {\r
-      if(red_buf[ii] > 10000)\r
-      {\r
-          ble_spo2_data = red_buf[ii];\r
-      }\r
-    }\r
-               \r
-               \r
+                       \r
 #ifndef GSEN_40MS_TIMMER\r
 //    readFifoByHrsModule();\r
 #endif\r
@@ -3246,6 +3233,9 @@ void hx3695_spo2_ppg_Int_handle(void)
               gsen_fifo_z_send[ii] = gsensordata[ii].z * 2048;\r
           }\r
 \r
+          if(abs(red_buf[ii]) > 10000)\r
+              ble_spo2_data = abs(red_buf[ii]) ;\r
+\r
           PRINT("hxdata:%d/%d %d %d %d %d %d %d\r\n",\r
             1+ii,*count,red_buf[ii],ir_buf[ii],green_buf[ii],gsen_fifo_x_send[ii],gsen_fifo_y_send[ii],gsen_fifo_z_send[ii]);\r
           //printf("FFF==>spo2  red_buf : %d,  %d,  %d,        %d \n", 1+ii, *count, red_buf[ii], ir_buf[0]);\r
@@ -3644,4 +3634,4 @@ void hx3695_lab_test_Int_handle(void)
 }\r
 #endif\r
 \r
-#endif  //CHIP_HX3695\r
+#endif  //CHIP_HX3695
\ No newline at end of file
index 276527e..d3b3b95 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-06-13 10:16:15
+ * @LastEditTime: 2024-06-17 17:43:19
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c
  * @Description: 
  * 
@@ -58,6 +58,8 @@ void ppg_send_cmd_to_driver(char* mode, uint8_t enable)
         md = FT_LED_OFF_MODE;
     } else if (strcmp(mode, "wear") == 0) {
         md = WEAR_MODE;
+    } else if (strcmp(mode, "single") == 0) {
+        md = FT_SINGLE_CHECK_MODE;
     } 
 
    
@@ -70,7 +72,7 @@ void ppg_send_cmd_to_driver(char* mode, uint8_t enable)
     } else {
 
     //    ppg_service_running_stat = false;
-       if(md == HRS_MODE|| md == FT_LEAK_LIGHT_MODE || md == FT_GRAY_CARD_MODE || md == WEAR_MODE)
+       if(md == HRS_MODE|| md == FT_LEAK_LIGHT_MODE || md == FT_GRAY_CARD_MODE || md == WEAR_MODE || md == FT_SINGLE_CHECK_MODE)
         {
 #ifdef HRS_ALG_LIB   
             hx3695_hrs_disable();
index ac3d3cb..5aa5df3 100644 (file)
@@ -332,6 +332,9 @@ static void ppg_service_check_task(void  *arg)
         }else if (mail == PPG_SERVICE_CMD_TYPE_DO_LED_OFF_MODE_TEST){
             cmd = "ledoff";
             enable = 0;
+        }else if (mail == PPG_SERVICE_CMD_TYPE_DO_SINGLE_CHECK_MODE_TEST){
+            cmd = "single";
+            enable = 1;
         }else if (mail == PPG_SERVICE_CMD_TYPE_STOP_WEAR_MODE_TEST){
             if (keep_in_wear_det_mod == 0) continue;
             cmd = "wear";
index 965e70d..bf0e0a1 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-06-13 09:42:57
+ * @LastEditTime: 2024-06-17 17:46:26
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/service/ppg_service.h
  * @Description: 
  * 
@@ -42,6 +42,7 @@ extern "C" {
 #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
+#define PPG_SERVICE_CMD_TYPE_DO_SINGLE_CHECK_MODE_TEST 0x23
 
 errcode_t uapi_ppg_service_init(void);
 void uapi_ppg_service_deinit(void);
index 146fc17..dd7c181 100644 (file)
@@ -2229,15 +2229,38 @@ void uapi_check_spk(bool isopen)
     #endif
 }
 
-void uapi_efuse_test(void)
+void uapi_efuse_test_write(uint8_t *data,uint32_t byte_number,uint8_t len)
 {
-    uint8_t writedata[8] = {1,2,3,4,5,6,7,8};
-    uint8_t readdata[8] = {0};
+    uint8_t readdata[10] = {0};
+    errcode_t ret = 0;
 
-    uapi_efuse_write_buffer(0x170, writedata, 8);
+    PRINT("byte_number : %d \r\n",byte_number);
 
-    uapi_efuse_read_buffer(readdata, 0x170, 8);
-    for(int i = 0; i < 8; i++)
-        PRINT("readdata[%d] : %d \r\n",i,readdata[i]);
+     for(int i = 0; i < len; i++)
+        PRINT("write_data[%d] : %d \r\n",i,data[i]);
+    ret = uapi_efuse_write_buffer(byte_number, data, len);
 
+    if(ret != ERRCODE_SUCC)
+        PRINT("uapi_efuse_write_buffer failed \r\n");
+
+    ret = uapi_efuse_read_buffer(readdata, byte_number, len);
+    if(ret != ERRCODE_SUCC)
+        PRINT("uapi_efuse_read_buffer failed \r\n");
+    for(int i = 0; i < len; i++)
+        PRINT("read_data[%d] : %d \r\n",i,readdata[i]);
+}
+
+void uapi_efuse_test_read(uint32_t byte_number,uint8_t len)
+{
+    uint8_t readdata[10] = {0};
+    errcode_t ret = 0;
+
+    PRINT("byte_number : %d \r\n",byte_number);
+
+    ret = uapi_efuse_read_buffer(readdata, byte_number, len);
+    if(ret != ERRCODE_SUCC)
+        PRINT("uapi_efuse_read_buffer failed \r\n");
+
+    for(int i = 0; i < len; i++)
+        PRINT("read_data[%d] : %d \r\n",i,readdata[i]);
 }
\ No newline at end of file
index 8856f04..9f3d44e 100644 (file)
@@ -205,7 +205,9 @@ void uapi_ppg_get_id(uint8_t *chip_id);
 
 void uapi_microhone_switch(bool isopen);
 void uapi_check_spk(bool isopen);
-void uapi_efuse_test(void);
+void uapi_efuse_test_write(uint8_t *data,uint32_t byte_number,uint8_t len);
+void uapi_efuse_test_read(uint32_t byte_number,uint8_t len);
+
 
 #include "custom_utilscpp.h"
 
index f1c4963..1f7271e 100644 (file)
@@ -592,16 +592,71 @@ static uint32_t custom_test_sntp(uint8_t *para, uint32_t paraLen, char *strCommo
     return ERRCODE_SUCC;
 }
 
-static uint32_t custom_uapi_efuse_test(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+static uint32_t custom_uapi_efuse_test_write(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
 {
 
     UNUSED(strCommonCmd);
+    uint8_t argv[CUSTOM_UTILS_MAX_ARGC][CUSTOM_UTILS_MAX_ARGV_LEN] = { 0 };
+    uint32_t argc = 0;
+    uint8_t send_data[8] = {0};
 
-    uapi_efuse_test();
+
+    int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
+    if (ret != CUSTOM_UTILS_SUCCESS) {
+        PRINT("CUSTOM_UTILSTEST ATCMD Convert Command Failed\n");
+        return ERRCODE_FAIL;
+    }
+
+    if (argc != 3) {
+        PRINT("CUSTOM_UTILSTEST power_test ATCMD Set Parameter Failed argc %d\r\nPM_DSP_POWER_UP_AND_RUN=2  PM_DSP_POWER_OFF=3\r\n",argc);
+        return ERRCODE_FAIL;
+    }
+
+    uint32_t add = atol((char*)argv[1]);
+    uint8_t len = atol((char*)argv[2]);
+
+    for(int i = 0; i < len; i++)
+    {
+        if(argv[0][i] >=65)
+            argv[0][i] = argv[0][i] - 65 + 10;
+        else
+            argv[0][i] = argv[0][i] - 48;
+
+        send_data[i] = argv[0][i];
+    }
+
+    uapi_efuse_test_write(send_data,add,len);
+    //uapi_boot_animotion_test();
 
     return ERRCODE_SUCC;
 }
 
+static uint32_t custom_uapi_efuse_test_read(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+
+    UNUSED(strCommonCmd);
+
+    uint8_t argv[CUSTOM_UTILS_MAX_ARGC][CUSTOM_UTILS_MAX_ARGV_LEN] = { 0 };
+    uint32_t argc = 0;
+
+    int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
+    if (ret != CUSTOM_UTILS_SUCCESS) {
+        PRINT("CUSTOM_UTILSTEST ATCMD Convert Command Failed\n");
+        return ERRCODE_FAIL;
+    }
+
+    if (argc != 2) {
+        PRINT("CUSTOM_UTILSTEST power_test ATCMD Set Parameter Failed argc %d\r\nPM_DSP_POWER_UP_AND_RUN=2  PM_DSP_POWER_OFF=3\r\n",argc);
+        return ERRCODE_FAIL;
+    }
+    uint32_t add = atol((char*)argv[0]);
+    uint8_t len = atol((char*)argv[1]);
+    uapi_efuse_test_read(add,len);
+
+    return ERRCODE_SUCC;
+}
+
+
 static const at_cmd_table_t g_custom_utils_cmd[] = {
     { (char *)"AT^CUSTOM_SN",      custom_utils_setsn, (char *)"123456789ABCDEF2345678" },
     { (char *)"AT^CUSTOM_SN_REQ",  custom_utils_getsn, (char *)" " },
@@ -648,10 +703,12 @@ static const at_cmd_table_t g_custom_utils_cmd[] = {
     { (char *)"AT^TIMESYNC",      custom_test_time_synct, (char *)" " },
     { (char *)"AT^24HOUR",      custom_test_time_showtype, (char *)" " },
 
-    { (char *)"AT^EFUSETEST",      custom_uapi_efuse_test, (char *)" " },
+    { (char *)"AT^EFUSEREAD",      custom_uapi_efuse_test_read, (char *)" " },
+    { (char *)"AT^EFUSEWRITE",      custom_uapi_efuse_test_write, (char *)" " },
 
 };
 
+
 at_cmd_table_t *get_custom_utils_cmd_table(uint32_t *cmd_count)
 {
     *cmd_count = ARRAY_COUNT(g_custom_utils_cmd);
index ad04606..04379c5 100755 (executable)
 #include "common/screen.h"
 #include "components/root_view.h"
 #include "components/ui_image_view.h"
-#include "rtcservice/include/rtc_at_cmd.h"
+#include "thread_init.h"
+#include "custom_utils.h"
+#include "components/ui_image_animator.h"
+#include "wearable_log.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -43,15 +46,172 @@ static bool g_showOtaLogo = false;
 static OHOS::UIImageView* g_ota_logo = nullptr;
 static OHOS::ImageInfo* g_ota_imgInfo = nullptr;
 
+static uint32_t *g_boot_animation_task_handle = NULL;
+
+static OHOS::UIViewGroup* group=nullptr;
+static OHOS::UIViewGroup* boot_group=nullptr;
+static OHOS::UIImageAnimatorView* ReBootImageAnimatorView=nullptr;
+static constexpr char *ReBootPaths = "/system/ReBoot/"; //开机图片路径
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_TIME = 150;           // 图片更新间隔
+static OHOS::ImageAnimatorInfo ReBootImageInfo[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 开机图像的信息
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_X = 0;
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_Y = 0;
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_W = 466;
+static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_H = 466;
+const char **ReBootPathsArray{nullptr};                                     // 开机图片路径数组
+static OHOS::UIImageAnimatorView::AnimatorStopListener *bootStoplistener{nullptr};
+static bool boot_animation_flag = false;
+static app_task_definition_t taskcfg={0};
+
 #ifdef QSPI_DISPLAY
 #define IMAGE_OPEN_LOGO_PATH "/user/res/OPEN_LOGO_QSPI.bin"
 #else
 #define IMAGE_OPEN_LOGO_PATH "/system/KUMI_LOGO.bin"
-#define Z1_IMAGE_OPEN_LOGO_PATH "/system/z1bootlogo.bin"
 #define IMAGE_OTA_LOGO_PATH "/system/OTAUpdata.bin"
-
 #endif
 
+static void FreeImagePathsArray(const char **imagePaths, const int numImages)
+{
+    for (int i = 0; i < numImages; i++)
+    {
+        delete imagePaths[i];
+        imagePaths[i] = nullptr;
+    }
+}
+
+static void ClearAll(void)
+{
+    if(group!=nullptr)
+    {
+        OHOS::RootView::GetInstance()->Remove(group);
+        group->RemoveAll();
+
+        if (ReBootImageAnimatorView != nullptr)
+        {
+            delete ReBootImageAnimatorView;
+            ReBootImageAnimatorView = nullptr;
+        }
+
+        if(bootStoplistener!=nullptr)
+        {
+            delete bootStoplistener;
+            bootStoplistener = nullptr;
+        }
+
+        FreeImagePathsArray(ReBootPathsArray, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+
+        delete group;
+        group = nullptr;
+    }
+}
+
+class BootAnimatorListener:public OHOS::UIImageAnimatorView::AnimatorStopListener
+{
+public:
+BootAnimatorListener(){}
+~BootAnimatorListener(){}
+
+private:
+    void OnAnimatorStop(OHOS::UIView &view)
+    {
+        boot_animation_flag = true;
+        
+        ClearAll();
+
+        errcode_t ret = uapi_terminate_thread(taskcfg.task_handle);
+
+        if(ret != ERRCODE_SUCC)
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"kill boot_animation_task failed %d!",ret);
+        else
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"kill boot_animation_task succed !");
+
+        //boot_group->SetVisible(false);
+        OHOS::RootView::GetInstance()->Remove(boot_group);
+        delete boot_group;
+        boot_group = nullptr;
+    }
+
+}; 
+
+
+static const char ** CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages)
+{
+    const char **imagePaths = new const char *[numImages];
+    char buffer[256];
+    for (int i = 0; i < numImages; i++)
+    {
+        if(i < 10)
+            snprintf(buffer, sizeof(buffer), "%s6S2400%d.%s", basePath, i , fileExtension);
+        else
+            snprintf(buffer, sizeof(buffer), "%s6S240%d.%s", basePath, i , fileExtension);
+        imagePaths[i] = strdup(buffer);
+    }
+    return imagePaths;
+}
+
+bool ShowReBootAnimatorView()
+{
+    ReBootPathsArray = CreateImagePathsArray(ReBootPaths, "bin", REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+
+    if (ReBootImageAnimatorView == nullptr)
+    {
+        ReBootImageAnimatorView = new OHOS::UIImageAnimatorView();
+        if (ReBootImageAnimatorView == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "new ReBootImageAnimatorView fail");
+            return false;
+        }
+        for (uint8_t i = 0; i < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
+        {
+            ReBootImageInfo[i].imagePath = (ReBootPathsArray[i]);
+            ReBootImageInfo[i].imageType = OHOS::IMG_SRC_FILE_PATH;
+            ReBootImageInfo[i].pos.x = REBOOT_IMAGE_ANIMATOR_VIEW_X;
+            ReBootImageInfo[i].pos.y = REBOOT_IMAGE_ANIMATOR_VIEW_Y;
+            ReBootImageInfo[i].width = REBOOT_IMAGE_ANIMATOR_VIEW_W;
+            ReBootImageInfo[i].height = REBOOT_IMAGE_ANIMATOR_VIEW_H;
+        }
+        ReBootImageAnimatorView->SetPosition(REBOOT_IMAGE_ANIMATOR_VIEW_X, REBOOT_IMAGE_ANIMATOR_VIEW_Y, REBOOT_IMAGE_ANIMATOR_VIEW_W, REBOOT_IMAGE_ANIMATOR_VIEW_H);
+        ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, 0xffffffff);
+        ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_OPA, 0xff);
+        ReBootImageAnimatorView->SetImageAnimatorSrc(ReBootImageInfo, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES, 100);
+        ReBootImageAnimatorView->SetRepeat(false);
+        ReBootImageAnimatorView->SetRepeatTimes(1);
+        
+        bootStoplistener = static_cast<OHOS::UIImageAnimatorView::AnimatorStopListener *>(new BootAnimatorListener());
+        if (bootStoplistener == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to Create bootStoplistener!!");
+            return false;
+        }
+        ReBootImageAnimatorView->SetAnimatorStopListener(bootStoplistener);
+    }
+
+
+    return true;
+}
+
+OHOS::UIViewGroup* ReBootAnimatorViewInit(void)
+{
+    bool ret;
+    group = new OHOS::UIViewGroup();
+    if (group == nullptr)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP," group new fail");
+        return nullptr;
+    }
+    group->SetPosition(0, 0, OHOS::HORIZONTAL_RESOLUTION, OHOS::VERTICAL_RESOLUTION);
+    group->SetStyle(OHOS::STYLE_BACKGROUND_OPA, OHOS::OPA_OPAQUE);
+    ret = ShowReBootAnimatorView();
+
+    if (ret == false)
+    {
+        return nullptr;
+    }
+
+    group->Add(ReBootImageAnimatorView);
+    return group;
+}
 
 static void UikitRTCCallBack(uintptr_t data)
 {
@@ -59,10 +219,6 @@ static void UikitRTCCallBack(uintptr_t data)
     if (!g_initialized || !g_isScreenOn) {
         return;
     }
-    if(get_printf())
-    {
-        printf("[g_timeInterval is %d ]\r\n",g_timeInterval);
-    }
     uapi_rtc_start(g_rtcHandle, g_timeInterval, UikitRTCCallBack, 0);
     GraphicService::GetInstance()->UpdateGraphicEvent();
 }
@@ -109,7 +265,6 @@ void NotifyScreenOn(void)
         OHOS::LowPowerManager::GetInstance()->ExitLowPower();
         uapi_rtc_start(g_rtcHandle, g_timeInterval, static_cast<rtc_callback_t>(UikitRTCCallBack), 0);
     }
-
     GraphicService::GetInstance()->NotifyScreenOn();
 }
 
@@ -158,20 +313,21 @@ void InitGraphicService(void)
 void HideGraphicLogo()
 {
     if (!g_showLogo) {
-        return;
-    }
-    g_showLogo = false;
-    OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent(
-        [] {
-            if (g_logo != nullptr) {
-                OHOS::RootView::GetInstance()->Remove(g_logo);
-                delete g_logo;
-                g_logo = nullptr;
-                OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OPEN_LOGO_PATH);
-                g_imgInfo = nullptr;
-            }
-        },
-        false);
+            return;
+        }
+
+        g_showLogo = false;
+        OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent(
+            [] {
+                if (g_logo != nullptr) {
+                    OHOS::RootView::GetInstance()->Remove(g_logo);
+                    delete g_logo;
+                    g_logo = nullptr;
+                    OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OPEN_LOGO_PATH);
+                    g_imgInfo = nullptr;
+                }
+            },
+            false);
 }
 
 void HideGraphicOtaLogo()
@@ -192,29 +348,60 @@ void HideGraphicOtaLogo()
         },
         false);
 }
+
+static void boot_animation_task(void *arg)
+{
+    unused(arg);
+
+    boot_group = ReBootAnimatorViewInit();
+    if (boot_group == nullptr)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP," boot_group nullptr fail");
+        return;
+    }
+
+    OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent(
+        [] {
+            OHOS::RootView::GetInstance()->Add(boot_group);
+            ReBootImageAnimatorView->Start();
+        },
+        false);
+
+}
+
 void ShowGraphicLogo(void)
 {
+    while(boot_animation_flag == false)
+    {
+        LOS_Mdelay(1);
+    }
     if (g_showLogo) {
-        return;
+    return;
     }
     g_showLogo = true;
     g_logo = new OHOS::UIImageView();
-    g_logo->SetPosition(0, 0, OHOS::Screen::GetInstance().GetWidth(), OHOS::Screen::GetInstance().GetHeight());
+    g_logo->SetPosition(0, 0, 466, 466);
     g_logo->SetAutoEnable(false);
     g_logo->SetResizeMode(OHOS::UIImageView::CENTER);
-    g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(Z1_IMAGE_OPEN_LOGO_PATH);
-    if (g_imgInfo == nullptr)
-        g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OPEN_LOGO_PATH);
+
+    g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OPEN_LOGO_PATH);
     g_logo->SetSrc(g_imgInfo);
+
     OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent(
         [] {
             OHOS::RootView::GetInstance()->Add(g_logo);
             OHOS::RootView::GetInstance()->Invalidate();
         },
         false);
+    
 }
+
 void ShowGraphicOTALogo(void)
 {
+    while(boot_animation_flag == false)
+    {
+        LOS_Mdelay(1);
+    }
     if (g_showOtaLogo) {
         return;
     }
@@ -232,6 +419,26 @@ void ShowGraphicOTALogo(void)
         },
         false);
 }
+
+void boot_animation_init(void)
+{
+    //ShowGraphicLogo();
+
+    taskcfg.task_handle = g_boot_animation_task_handle;
+    taskcfg.attr.name="boot_animation_service";
+    taskcfg.attr.priority = TASK_PRIORITY_SDK;
+    taskcfg.attr.stack_size = 0x1000;
+    taskcfg.func = boot_animation_task;
+    taskcfg.use_mem = USE_EXTEND_MEM;
+    
+    errcode_t ret=uapi_create_osThread_custom(&taskcfg);
+    if(ret != ERRCODE_SUCC)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"create boot_animation_task failed %d!",ret);
+        return ;
+    }
+}
+
 #ifdef __cplusplus
 };
 #endif