From: 彭磊 <1624952103@qq.com> Date: Mon, 17 Jun 2024 12:25:45 +0000 (+0000) Subject: Merge #300 into sdk602patch0521 from refs/changes/300/head X-Git-Tag: release_V1.2.70_20241020_135402~989^2~1^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=1a1eb03573eac0ac5d388d10dac1fb7cb3ab8157;p=mirrors%2FFD230.git Merge #300 into sdk602patch0521 from refs/changes/300/head Code review from 彭磊 * refs/changes/300/head: (10 commits squashed) - 优化蓝牙产测,添加ppg关闭led指令 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521 - 蓝牙产测添加NTC测试指令 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521 - 添加开机动画,优化蓝牙产测,优化久坐提醒设置,添加efuse读写测试接口 - 补交 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521 - 优化蓝牙产测与开机动画 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into remotes/origin/sdk602patch0521 - 补交 Signed-off-by: aliyun6865282430 <1624952103@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/300 --- diff --git a/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c b/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c index f2e077caa..4160dcc13 100755 --- a/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c +++ b/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c @@ -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 diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c index ce293ef40..64073c01f 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -1,3 +1,13 @@ +/* + * @Author: penglei 1624952103@qq.com + * @Date: 2024-06-17 14:31:08 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2024-06-17 17:51:27 + * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c + * @Description: + * + * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. + */ /* * Copyright (c) @CompanyNameMagicTag 2022. All rights reserved. * Description: BT HID Service Server Module. @@ -65,18 +75,18 @@ static int factorytest_mode_flag = 0; ble_aging_t aging_t; -static osTimerId_t g_ble_vibrator_timer; +static osTimerId_t g_ble_vibrator_timer = NULL; -static osTimerId_t g_ble_acc_timer; +static osTimerId_t g_ble_acc_timer = NULL; -static osTimerId_t g_ble_hrs_timer; -static osTimerId_t g_ble_spo2_timer; - -static osTimerId_t g_ble_microhone_timer; -static osTimerId_t g_ble_spk_timer; +static osTimerId_t g_ble_microhone_timer = NULL; +static osTimerId_t g_ble_spk_timer = NULL; static uint32_t aging_time = 0; +static uint8_t pwr_button_result = 0; +static uint8_t func_button_result = 1; + static int CRC16_XMODEM(uint8_t *bytes,uint16_t length) { int crc = 0x0000; // initial value int polynomial = 0x1021; @@ -127,64 +137,28 @@ errcode_t factorytest_protocol_replymsg(uint8_t mode, uint8_t submode,uint8_t te static void pwr_button_callback_press(void) { - uint8_t send_data = 1; - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, - 0x02, - &send_data, - 1); + pwr_button_result = 1; } static void pwr_button_callback_click_2(void) { - uint8_t send_data = 3; - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, - 0x02, - &send_data, - 1); + pwr_button_result = 3; } static void pwr_button_callback_long_press_2s(void) { - uint8_t send_data = 2; - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, - 0x02, - &send_data, - 1); + pwr_button_result = 2; } static void func_button_callback_press(void) { - uint8_t send_data = 1; - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, - 0x03, - &send_data, - 1); + func_button_result = 1; } static void func_button_callback_click_2(void) { - uint8_t send_data = 3; - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, - 0x03, - &send_data, - 1); + func_button_result = 3; } static void func_button_callback_long_press_2s(void) { - uint8_t send_data = 2; - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, - 0x03, - &send_data, - 1); + func_button_result = 2; } void ble_vibrator_check_timer_callback(void) @@ -204,77 +178,9 @@ void ble_acc_check_timer_callback(void) 6); } - -void ble_hrs_check_timer_callback(void) -{ - uint8_t databuf[4] = {0}; - int32_t ppg_buf; - uint8_t i; - if(ble_hrs_flag == 1) - { - ble_hrs_flag = 0; - osTimerStop(g_ble_hrs_timer); - osTimerDelete(g_ble_hrs_timer); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); - return; - } - - if(ble_hrs_data > 10000) - { - ppg_buf = ble_hrs_data; - - databuf[0] = (uint8_t)((ppg_buf & 0xFF000000) >> 24); - databuf[1] = (uint8_t)((ppg_buf & 0x00FF0000) >> 16); - databuf[2] = (uint8_t)((ppg_buf & 0x0000FF00) >> 8); - databuf[3] = (uint8_t)((ppg_buf & 0x000000FF) >> 0); - - PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]); - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, - 0x03, - databuf, - 4); - } - -} - -void ble_spo2_check_timer_callback(void) -{ - uint8_t databuf[4] = {0}; - int32_t red_buf; - - if(ble_spo2_flag == 1) - { - ble_spo2_flag = 0; - osTimerStop(g_ble_spo2_timer); - osTimerDelete(g_ble_spo2_timer); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_SPO2_TEST); - return; - } - - if(ble_spo2_data > 10000) - { - red_buf = ble_spo2_data; - - databuf[0] = (uint8_t)((red_buf & 0xFF000000) >> 24); - databuf[1] = (uint8_t)((red_buf & 0x00FF0000) >> 16); - databuf[2] = (uint8_t)((red_buf & 0x0000FF00) >> 8); - databuf[3] = (uint8_t)((red_buf & 0x000000FF) >> 0); - - PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]); - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, - 0x04, - databuf, - 4); - } - -} - void ble_microhone_check_timer_callback(void) { + PRINT("ble_microhone_check_timer_callback \r\n"); uint8_t send_data= 0; uapi_microhone_switch(0); @@ -777,7 +683,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 1); } else if(testitem == 0x02) { - //查询电源键测试结果 + //开启电源键测试 uint8_t send_data = 0; uapi_button_register_event_cb(pwr_button_callback_press, 1); @@ -791,7 +697,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 1); } else if(testitem == 0x03) { - //查询功能键测试结果 + //开启功能键测试 uint8_t send_data = 0; uapi_button_register_event_cb(func_button_callback_press, 24); @@ -803,6 +709,26 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 0x03, &send_data, 1); + } else if(testitem == 0x04) + { + //查询电源键测试结果 + uint8_t send_data = pwr_button_result; + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, + 0x04, + &send_data, + 1); + } else if(testitem == 0x05) + { + //查询功能键测试结果 + uint8_t send_data = func_button_result; + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, + 0x05, + &send_data, + 1); } break; @@ -1043,7 +969,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //LCD显示颜色 uint8_t send_data = 0x00; char *color_buf[5] ={"0Xffff0000","0xff00ff00","0xff0000ff","0xffffffff","0xff000000"}; - ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); + ScreenAlwaysOnCtr(1); switch (*data) { case 1: @@ -1242,16 +1168,44 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint } else if(testitem == 0x03) { //打开心率检测 - g_ble_hrs_timer = osTimerNew((osTimerFunc_t)ble_hrs_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_hrs_timer,400); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_PPG_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_SINGLE_CHECK_MODE_TEST); + FT_RESULTS_t ft_result = hx3695_factroy_test(SINGLE_CHECK_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); + uint8_t databuf[4] = {0}; + + databuf[0] = (uint8_t)((ft_result.gr_data_final & 0xFF000000) >> 24); + databuf[1] = (uint8_t)((ft_result.gr_data_final & 0x00FF0000) >> 16); + databuf[2] = (uint8_t)((ft_result.gr_data_final & 0x0000FF00) >> 8); + databuf[3] = (uint8_t)((ft_result.gr_data_final & 0x000000FF) >> 0); + + PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]); + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, + 0x03, + databuf, + 4); } else if(testitem == 0x04) { //打开血氧检测 - g_ble_spo2_timer = osTimerNew((osTimerFunc_t)ble_spo2_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_spo2_timer,400); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_SPO2_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_SINGLE_CHECK_MODE_TEST); + FT_RESULTS_t ft_result = hx3695_factroy_test(SINGLE_CHECK_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); + uint8_t databuf[4] = {0}; + + databuf[0] = (uint8_t)((ft_result.red_data_final & 0xFF000000) >> 24); + databuf[1] = (uint8_t)((ft_result.red_data_final & 0x00FF0000) >> 16); + databuf[2] = (uint8_t)((ft_result.red_data_final & 0x0000FF00) >> 8); + databuf[3] = (uint8_t)((ft_result.red_data_final & 0x000000FF) >> 0); + + PRINT("%2X %2X %2X %2X \r\n",databuf[0],databuf[1],databuf[2],databuf[3]); + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, + 0x04, + databuf, + 4); } else if(testitem == 0x05) { @@ -1512,9 +1466,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint uint8_t send_data[2] = {0}; uint16_t len = sizeof(send_data); - cat1_getsignal(); - msleep(1000); - send_data[1]=uapi_dev_runtime_get_cat1_simstat(); + send_data[1] = uapi_dev_runtime_get_cat1_simstat(); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1, 0x03, @@ -1525,9 +1477,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //查看信号强度 uint8_t send_data[2] = {0}; - cat1_getsignal(); - msleep(1000); - send_data[1]=uapi_dev_runtime_get_cat1_signal(); + send_data[1] = uapi_dev_runtime_get_cat1_signal(); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1, @@ -1537,19 +1487,18 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint } else if(testitem == 0x05) { //查看网络类型 - uint8_t send_data = 0x00; + uint8_t send_data[2] = {0}; cat1_getsignal(); msleep(1000); - - PRINT("send_buf : %s \r\n",uapi_dev_runtime_get_cat1_operator()); - + send_data[1] = uapi_dev_runtime_get_cat1_networtype(); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1, 0x05, - (uint8_t *)uapi_dev_runtime_get_cat1_operator(), - strlen(uapi_dev_runtime_get_cat1_operator())); + send_data, + 2); } else if(testitem == 0x06) { //拨打电话 @@ -1627,16 +1576,16 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint if(testitem == 0x01) { //开始录音 - g_ble_microhone_timer = osTimerNew((osTimerFunc_t)ble_microhone_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_microhone_timer,5000); uapi_microhone_switch(1); + g_ble_microhone_timer = osTimerNew((osTimerFunc_t)ble_microhone_check_timer_callback, osTimerPeriodic, NULL, NULL); + osStatus_t ret = osTimerStart(g_ble_microhone_timer,5000); } else if(testitem == 0x02) { //播放录音 - g_ble_microhone_timer = osTimerNew((osTimerFunc_t)ble_spk_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_spk_timer,5000); uapi_check_spk(1); + g_ble_spk_timer = osTimerNew((osTimerFunc_t)ble_spk_check_timer_callback, osTimerPeriodic, NULL, NULL); + osTimerStart(g_ble_spk_timer,5000); } break; diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h index 47cc3f500..ab2474cf7 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h @@ -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 index 000000000..df0fd9111 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24000.bin @@ -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 index 000000000..63c9dd232 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24001.bin @@ -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 index 000000000..3fc424bde --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24002.bin @@ -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 index 000000000..b7f87866a --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24003.bin @@ -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 index 000000000..495ba590b --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24004.bin @@ -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 index 000000000..ffdcfc379 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24005.bin @@ -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 index 000000000..26ae63cdf --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24006.bin @@ -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 index 000000000..34cecf465 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24007.bin @@ -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 index 000000000..eba375727 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24008.bin @@ -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 index 000000000..9190647fb --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24009.bin @@ -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 index 000000000..0dcae4c9a --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24010.bin @@ -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 index 000000000..5a71e53b5 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24011.bin @@ -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 index 000000000..563ffbba5 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24012.bin @@ -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 index 000000000..782884be4 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24013.bin @@ -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 index 000000000..6116b808a --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24014.bin @@ -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 index 000000000..18cffae84 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24015.bin @@ -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 index 000000000..77f6c1a30 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24016.bin @@ -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 index 000000000..0e326b78e --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24017.bin @@ -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 index 000000000..4ff0ab15c --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24018.bin @@ -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 index 000000000..aa6ca337e --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24019.bin @@ -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 index 000000000..f36a6e1de --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24020.bin @@ -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 index 000000000..779c4d1d1 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24021.bin @@ -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 index 000000000..76a8f36c7 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24022.bin @@ -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 index 000000000..d1e932cab --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24023.bin @@ -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 index 000000000..78aab2326 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24024.bin @@ -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 index 000000000..fc2a0aec0 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24025.bin @@ -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 index 000000000..7ac4fe013 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24026.bin @@ -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 index 000000000..d04cbd239 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24027.bin @@ -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 index 000000000..8f652493f --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24028.bin @@ -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 index 000000000..4fb68c2eb --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/ReBoot/6S24029.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e08795fdde6362abb0f7aa9bac7a6587cdf7d79ee73dd5284a7c2990d5c15567 +size 146040 diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h index 88a353e7a..cc96fc6c4 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h @@ -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() diff --git a/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c b/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c index d0b3fed0a..55846fa10 100644 --- a/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c +++ b/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c @@ -96,6 +96,7 @@ int mmc5603_start(void) { for(i=0;i<4;i++) { + PRINT("saveData[%d] : %f \r\n",i,saveData[i]); mag_hmm[i] = saveData[i]; } } @@ -273,6 +274,8 @@ int SavePara(float *p) int SavePara_infile(float *p,uint32_t len) { + for(int i = 0; i < len ; i++) + PRINT("p[%d] : %f \r\n",i,p[i]); FILE * fp = fopen(MMC_DATA_PATH,"wb"); int ret = 0; if(fp==NULL) diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 9e5320690..a2763bc1f 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2724,14 +2724,6 @@ void hx3695_hrs_ppg_Int_handle(void) return; } - for(ii = 0; ii < hrs_s_dat.count; ii++) - { - if(PPG_buf[ii] > 10000) - { - ble_hrs_data = PPG_buf[ii]; - } - } - #ifndef GSEN_40MS_TIMMER //readFifoByHrsModule(); #endif @@ -2781,6 +2773,10 @@ void hx3695_hrs_ppg_Int_handle(void) gsen_fifo_y_send[ii] = gsensordata[ii].y * 2048; gsen_fifo_z_send[ii] = gsensordata[ii].z * 2048; } + + if(abs(PPG_buf[ii]) > 10000) + ble_hrs_data = abs(PPG_buf[ii]); + //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); 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); @@ -3210,16 +3206,7 @@ void hx3695_spo2_ppg_Int_handle(void) { return; } - - for(ii = 0; ii < hrs_s_dat.count; ii++) - { - if(red_buf[ii] > 10000) - { - ble_spo2_data = red_buf[ii]; - } - } - - + #ifndef GSEN_40MS_TIMMER // readFifoByHrsModule(); #endif @@ -3246,6 +3233,9 @@ void hx3695_spo2_ppg_Int_handle(void) gsen_fifo_z_send[ii] = gsensordata[ii].z * 2048; } + if(abs(red_buf[ii]) > 10000) + ble_spo2_data = abs(red_buf[ii]) ; + PRINT("hxdata:%d/%d %d %d %d %d %d %d\r\n", 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]); //printf("FFF==>spo2 red_buf : %d, %d, %d, %d \n", 1+ii, *count, red_buf[ii], ir_buf[0]); @@ -3644,4 +3634,4 @@ void hx3695_lab_test_Int_handle(void) } #endif -#endif //CHIP_HX3695 +#endif //CHIP_HX3695 \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c index 276527e9f..d3b3b95d6 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c @@ -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(); diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index ac3d3cbc5..5aa5df38b 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -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"; diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.h b/code/sdk/drivers/peripheral/ppg/service/ppg_service.h index 965e70d69..bf0e0a19c 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.h +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.h @@ -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); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 146fc17e8..dd7c181c6 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -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 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 8856f04df..9f3d44e6b 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -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" diff --git a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c index f1c49636e..1f7271e66 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c @@ -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); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp index ad04606dc..04379c523 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp @@ -23,7 +23,10 @@ #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(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(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