From: penglei <1624952103@qq.com> Date: Wed, 8 May 2024 12:20:09 +0000 (+0800) Subject: 优化产测代码,添加alipay测试,优化睡眠模式 X-Git-Tag: release_V1.2.70_20241020_135402~1025^2~11 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=refs%2Fchanges%2F149%2Fhead;p=mirrors%2FFD230.git 优化产测代码,添加alipay测试,优化睡眠模式 --- diff --git a/code/sdk/application/wearable/alipay/driver_adapt/IIC_Master_Driver.h b/code/sdk/application/wearable/alipay/driver_adapt/IIC_Master_Driver.h index 6d0a28343..3221479ed 100755 --- a/code/sdk/application/wearable/alipay/driver_adapt/IIC_Master_Driver.h +++ b/code/sdk/application/wearable/alipay/driver_adapt/IIC_Master_Driver.h @@ -1,3 +1,13 @@ +/* + * @Author: penglei 1624952103@qq.com + * @Date: 2024-03-13 15:08:38 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2024-05-08 20:14:46 + * @FilePath: /fd230new/code/sdk/application/wearable/alipay/driver_adapt/IIC_Master_Driver.h + * @Description: + * + * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. + */ /** * Copyright (c) CompanyNameMagicTag 2021-2022. All rights reserved. * Description: Alipay sec soc driver adapt. @@ -12,7 +22,7 @@ unsigned char *IIC_Master_Init(void); -void IIC_Master_Send(unsigned char byAddr, unsigned char *pData, unsigned short wLen); +int IIC_Master_Send(unsigned char byAddr, unsigned char *pData, unsigned short wLen); void IIC_Master_Receive(unsigned char byAddr, unsigned char *pData, unsigned short wLen); diff --git a/code/sdk/application/wearable/alipay/driver_adapt/soc_adapt.c b/code/sdk/application/wearable/alipay/driver_adapt/soc_adapt.c index 60b409672..3f676ec5f 100755 --- a/code/sdk/application/wearable/alipay/driver_adapt/soc_adapt.c +++ b/code/sdk/application/wearable/alipay/driver_adapt/soc_adapt.c @@ -31,7 +31,7 @@ unsigned char *IIC_Master_Init(void) return g_alipay_i2c_mempool; } -void IIC_Master_Send(unsigned char byAddr, unsigned char *pData, unsigned short wLen) +int IIC_Master_Send(unsigned char byAddr, unsigned char *pData, unsigned short wLen) { errcode_t ret; uint32_t retry; @@ -69,7 +69,7 @@ void IIC_Master_Send(unsigned char byAddr, unsigned char *pData, unsigned short MyPrintf("se i2c data write byAddr(0x%x),pData(0x%s),wLen(%d),ret=0x%x",byAddr, printbuf,wLen,ret); #endif - return; + return ret; } void IIC_Master_Receive(unsigned char byAddr, unsigned char *pData, unsigned short wLen) diff --git a/code/sdk/application/wearable/alipay/service/alipay_feature.c b/code/sdk/application/wearable/alipay/service/alipay_feature.c index 8d3a53b3c..653cd2581 100644 --- a/code/sdk/application/wearable/alipay/service/alipay_feature.c +++ b/code/sdk/application/wearable/alipay/service/alipay_feature.c @@ -208,11 +208,10 @@ void svr_alipay_enter_lpm(void) return; } -void svr_alipay_exit_lpm(void) +int svr_alipay_exit_lpm(void) { uint32_t data; - csi_exit_lpm((void *)&data); - return; + return csi_exit_lpm((void *)&data); } int32_t svr_alipay_trans_get_last_code(char *title, uint8_t *transitcode, uint32_t *len) diff --git a/code/sdk/application/wearable/alipay/service/alipay_feature.h b/code/sdk/application/wearable/alipay/service/alipay_feature.h index 750cd5044..e933c02ac 100755 --- a/code/sdk/application/wearable/alipay/service/alipay_feature.h +++ b/code/sdk/application/wearable/alipay/service/alipay_feature.h @@ -244,7 +244,7 @@ typedef struct alipay_svr_api { * so there is generally no need to explicitly call the interface. * @return NULL */ - void (*exit_lpm)(void); + int (*exit_lpm)(void); /* * @ingroup service api 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 3f1982b83..3803d2b51 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -862,7 +862,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"}; - + mcu_pm_lcd_on(0,0); switch (*data) { case 1: @@ -1350,6 +1350,21 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 1); } break; + case BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ALIPAY: + if(testitem == 0x01) + { + //alipay test + uint8_t send_data[2] = {0}; + + send_data[1] = custom_exit_lpm(); + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ALIPAY, + 0x01, + send_data, + 2); + } + break; default: printf(""); 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 380921662..c2478b8ff 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h @@ -93,6 +93,8 @@ extern "C" { #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1 0x1A //软件测试 子模式ID 通讯录 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CONTACTS 0x30 +//软件测试 子模式ID 支付宝 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ALIPAY 0x31 /** * * encode cmd msg string and send to ble diff --git a/code/sdk/drivers/boards/brandy_evb/board_config/board_evb.h b/code/sdk/drivers/boards/brandy_evb/board_config/board_evb.h index 7c2bf4a39..7b233fc6a 100755 --- a/code/sdk/drivers/boards/brandy_evb/board_config/board_evb.h +++ b/code/sdk/drivers/boards/brandy_evb/board_config/board_evb.h @@ -16,7 +16,7 @@ #endif #ifdef ENABLE_CYWEE -extern void cywee_int1_callback(pin_t pin, uintptr_t param); +extern void cywee_int_callback(pin_t pin, uintptr_t param); #endif /** * @addtogroup connectivity_config_boards @@ -291,8 +291,8 @@ const hal_gpio_config_t g_gpio_function_config[PIN_MAX_NUMBER] = { #ifdef ENABLE_CYWEE /**G sensor G_INT1 S_AGPIO_L11 G_INT2 S_AGPIO_L19*/ - //{ S_AGPIO_L11, HAL_GPIO_DIRECTION_INPUT, HAL_GPIO_LEVEL_LOW, GPIO_INTERRUPT_RISING_EDGE, cywee_int1_callback }, - { S_AGPIO_L19, HAL_GPIO_DIRECTION_INPUT, NULL, GPIO_INTERRUPT_DEDGE, cywee_int1_callback }, + //{ S_AGPIO_L11, HAL_GPIO_DIRECTION_INPUT, HAL_GPIO_LEVEL_LOW, GPIO_INTERRUPT_RISING_EDGE, cywee_int_callback }, + { S_AGPIO_L19, HAL_GPIO_DIRECTION_INPUT, NULL, HAL_GPIO_LEVEL_HIGH, cywee_int_callback }, // { S_AGPIO_L19, HAL_GPIO_DIRECTION_INPUT, HAL_GPIO_LEVEL_LOW, 0, NULL }, #endif /**S_AGPIO_R1 GPO alipay默认resetpin*/ diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h index f91ff783c..50ece2245 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h @@ -502,6 +502,7 @@ void cywee_oncharging_update(int oncharging_status); void cywee_wearstatus_update(int wearstatus); void cywee_hrs_wearstatus_update(int hrs_data,int wearstatus); void cywee_set_user_info(int age,int gender,int weight,int height,int wearing_method); +void cywee_get_sleep_data(void); extern uint8_t hrs_mode_state; @@ -525,13 +526,17 @@ extern uint8_t hrs_mode_state; int cywee_main_dml(void); void cywee_int_handler(void); -void set_user_info(int age,int gender,double weight,int height,int wearing_method); +void cywee_set_user_info(int age,int gender,int weight,int height,int wearing_method); +void cywee_reset_daily_data(void); +void cywee_get_sleep_data(void); void cyw_inactivity_mode_change(int mode); void cyw_activity_mode_change(int mode); void hand_updown_switch(int cmd); + + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h index 4704837bb..c30306414 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h @@ -74,7 +74,7 @@ void uapi_cywee_service_deinit(void); * 测试指令 参数cmd 选项: ACC_SERVICE_CMD_START_CHECK,ACC_SERVICE_CMD_STOP_CHECK */ void do_cywee_service_check_msg(int cmd, int data[2]); -void cywee_int1_callback(pin_t pin, uintptr_t param); +void cywee_int_callback(pin_t pin, uintptr_t param); #ifdef __cplusplus } diff --git a/code/sdk/drivers/peripheral/cywee/service/cywee_service.c b/code/sdk/drivers/peripheral/cywee/service/cywee_service.c index 06d1edc8c..735823e71 100644 --- a/code/sdk/drivers/peripheral/cywee/service/cywee_service.c +++ b/code/sdk/drivers/peripheral/cywee/service/cywee_service.c @@ -401,7 +401,7 @@ errcode_t uapi_cywee_service_init(void) return ERRCODE_SUCC; } -void cywee_int1_callback(pin_t pin, uintptr_t param) +void cywee_int_callback(pin_t pin, uintptr_t param) { // PRINT("cywee_int1_callback %d 0x%X\n",pin,param); uapi_gpio_clear_interrupt(pin); diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 8aa607a53..772c6ca7b 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -49,15 +49,22 @@ void hand_updown_switch(int cmd) CWM_Sensor_Disable(IDX_ALGO_WATCH_HANDUP); } -void get_sleep_data(void) + +void cywee_reset_daily_data(void) +{ + memset(&scl, 0, sizeof(scl)); + CWM_SettingControl(SCL_RESET_DAILY_INFO, &scl); +} + + +void cywee_get_sleep_data(void) { memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; - scl.iData[1] = 0; + scl.iData[1] = 0; //0 立即输出,但不中止睡眠。 1 立即输出且中止睡眠 CWM_SettingControl(SCL_REQ_SLEEPING_DATA, &scl); } - void cywee_set_user_info(int age,int gender,int weight,int height,int wearing_method) { memset(&scl, 0, sizeof(scl)); @@ -70,7 +77,7 @@ void cywee_set_user_info(int age,int gender,int weight,int height,int wearing_me CWM_SettingControl(SCL_USER_INFO, &scl); } -void cywee_inactivity_time_sync(void) +void cywee_time_sync(void) { time_t rawtime; struct tm* timeinfo; @@ -140,7 +147,7 @@ void activity_mode_setstatus(int cmd) void cyw_inactivity_mode_change(int mode) { - cywee_inactivity_time_sync(); + cywee_time_sync(); switch (mode) { //無作用 @@ -170,17 +177,6 @@ void cyw_inactivity_mode_change(int mode) //久坐、有效站立和小睡 case INACTIVITY_MODE_SEDENTARY_AND_NAP: - /* - SCL_REQ_SLEEPING_DATA - int[0] = 1 - int[1] = terminate_sleep - (0: 立刻輸出狀態,但不中止此段睡眠偵測, - 1: 立刻輸出狀態,並中止此段睡眠偵測) - */ - memset(&scl, 0, sizeof(scl)); - scl.iData[0] = 1; - scl.iData[1] = 1; - CWM_SettingControl(SCL_REQ_SLEEPING_DATA, &scl); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = 3; @@ -836,7 +832,7 @@ int cywee_main_dml(void) // scl.iData[4] = 5; // scl.iData[7] = -1; // CWM_SettingControl(SCL_LOG, &scl); - // CWM_SettingControl(SCL_LOG, &scl); + //呼叫任一個CWM_Sensor_Enable 前呼叫此指令 设置手动或自动模式 memset(&scl, 0, sizeof(scl)); @@ -847,11 +843,6 @@ int cywee_main_dml(void) CWM_SettingControl(SCL_DML_DRV_ENABLE, &scl); //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); - // memset(&scl, 0, sizeof(scl)); - // scl.iData[0] = 1; - // scl.iData[3] = 3; - // scl.iData[4] = 5; - CWM_Sensor_Enable(IDX_REQUEST_SENSOR); // //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); CWM_Sensor_Enable(IDX_ALGO_WATCH_HANDUP); @@ -872,18 +863,6 @@ int cywee_main_dml(void) cyw_inactivity_mode_change(INACTIVITY_MODE_SEDENTARY); - // cyw_activity_mode_change(cmd); - // if(cmd == SPORT_ACTIVE_MODE_NORMAL) - // { - // cyw_inactivity_mode_change(INACTIVITY_MODE_SEDENTARY); - // } - // memset(&scl, 0, sizeof(scl)); - // scl.iData[0] = 1; - // scl.iData[1] = SPORT_ACTIVE_MODE_NORMAL; //ACTIVITY_MODE_NORMAL 1001 - // CWM_SettingControl(SCL_SET_ACTIVITY_MODE, &scl); - // CWM_SettingControl(SCL_SET_INACTIVITY_MODE, &scl); - //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); - return 0; } diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index fe4c7c0eb..9114c2e89 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1717,4 +1717,33 @@ void uapi_exit_power_saving_mode(void) //开启心率周期检测 -} \ No newline at end of file +} + +void uapi_get_sleeping_data(void) +{ + cywee_get_sleep_data(); +} + +void cywee_get_id(void) +{ + uint8_t id = 0; + custom_i2c_read_regs(0x19,0x0FU,1,&id,1,I2C_BUS_2); + PRINT("cywee id : 0x%X \r\n",id); +} + +#ifdef SUPPORT_ALIPAY_SEC +#include "alipay_feature.h" +int custom_exit_lpm(void) +{ + int ret; + const alipay_svr_api_t *alipay_api = alipay_svr_get_api(); + ret = alipay_api->exit_lpm(); + + if(ret == 0) + PRINT("ALIPAY TEST SUCCED !!! \r\n"); + else + PRINT("ALIPAY TEST FAILED !!! \r\n"); + + return ret; +} +#endif \ 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 6cd128c7f..c8090381b 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -162,6 +162,11 @@ errcode_t custom_i2c_transfer(uint16_t slaveAddr, uint16_t reg, int regLength, u uint32_t custom_i2c_suspend(void); uint32_t custom_i2c_resume(void); +void uapi_get_sleeping_data(void); +void cywee_get_id(void); +int custom_exit_lpm(void); + + #ifdef __cplusplus } #endif /* __cplusplus */ 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 6e58ff7ec..5e78446fb 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c @@ -368,10 +368,53 @@ static uint32_t custom_get_mmc_id(uint8_t *para, uint32_t paraLen, char *strComm unsigned char id; mmc5603_getid(&id); + PRINT("mmc5603 id : 0x%X \r\n",id); + return ERRCODE_SUCC; +} + +static uint32_t custom_get_sleeping_data(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + + UNUSED(strCommonCmd); + + uapi_get_sleeping_data(); return ERRCODE_SUCC; } +static uint32_t custom_iic_reset(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + + UNUSED(strCommonCmd); + + custom_i2c_reset(); + + return ERRCODE_SUCC; +} + + + +static uint32_t custom_get_cywee_id(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + + UNUSED(strCommonCmd); + + cywee_get_id(); + + return ERRCODE_SUCC; +} + +static uint32_t custom_alipay_exit_test(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + + UNUSED(strCommonCmd); + + custom_exit_lpm(); + + 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 *)" " }, @@ -405,6 +448,12 @@ static const at_cmd_table_t g_custom_utils_cmd[] = { { (char *)"AT^GETMMCID", custom_get_mmc_id, (char *)" " }, + { (char *)"AT^IICRESET", custom_iic_reset, (char *)" " }, + + { (char *)"AT^GETCYWEEID", custom_get_cywee_id, (char *)" " }, + + { (char *)"AT^EXITLPM", custom_alipay_exit_test, (char *)" " }, + }; at_cmd_table_t *get_custom_utils_cmd_table(uint32_t *cmd_count) diff --git a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/lib/rv70_llvm/hal/csi/inc/vendor_csi.h b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/lib/rv70_llvm/hal/csi/inc/vendor_csi.h index b200ffc72..85382f22a 100644 --- a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/lib/rv70_llvm/hal/csi/inc/vendor_csi.h +++ b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/lib/rv70_llvm/hal/csi/inc/vendor_csi.h @@ -11,7 +11,7 @@ EXTERNC void csi_enter_lpm(void *ctx); /* *退出低功耗模式 */ -EXTERNC void csi_exit_lpm(void *ctx); +EXTERNC int csi_exit_lpm(void *ctx); /* *发送请求 diff --git a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.c b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.c index 72b418e7d..357aee406 100755 --- a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.c +++ b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.c @@ -148,9 +148,9 @@ void HS_IIC_Init(void) //发送: C8 + LEN(2) + { 命令及数据} ^ g_TransTmpKey + CRC //返回FALSE表示接收指令或数据CRC校验错误 -void HS_IIC_Send_Cmd(unsigned char *pData, unsigned short wLen) +int HS_IIC_Send_Cmd(unsigned char *pData, unsigned short wLen) { - IIC_Master_Send(0xC8, pData, wLen); + return IIC_Master_Send(0xC8, pData, wLen); } //接收: C9 + 55 diff --git a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.h b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.h index 00872e789..6670fe8f7 100755 --- a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.h +++ b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.h @@ -1,3 +1,13 @@ +/* + * @Author: penglei 1624952103@qq.com + * @Date: 2024-03-13 15:09:15 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2024-05-08 17:23:56 + * @FilePath: /FD230/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/hsc32i1/hs_private.h + * @Description: + * + * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. + */ #ifndef __HS_PRIVATE_H__ #define __HS_PRIVATE_H__ @@ -18,7 +28,7 @@ extern unsigned char lmemcmp(unsigned char *pBuf1, unsigned char *pBuf2, unsigne extern void HS_IIC_Init(void); -extern void HS_IIC_Send_Cmd(unsigned char *pData, unsigned short wLen); +extern int HS_IIC_Send_Cmd(unsigned char *pData, unsigned short wLen); extern unsigned char HS_IIC_Recv_Resp(unsigned char *pData, unsigned short wLen); extern void Delay_Ms(unsigned char byMilliSec); diff --git a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/vendor_ssp.c b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/vendor_ssp.c index d7bb6c3a7..89261f90f 100755 --- a/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/vendor_ssp.c +++ b/code/sdk/vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/se/hsec/vendor_ssp.c @@ -589,10 +589,11 @@ void csi_enter_lpm(void *ctx) ■ ctx - 保存进入低功耗前的需要保存的上下文 ○ 返回值 ■ 无*/ -void csi_exit_lpm(void *ctx) +int csi_exit_lpm(void *ctx) { unsigned char abyVer[8]; unsigned char i; + int ret = 0; g_HSI2CBuf[0] = 0x00; g_HSI2CBuf[1] = 0x05; @@ -620,17 +621,17 @@ void csi_exit_lpm(void *ctx) Delay_Ms(15); - HS_IIC_Send_Cmd(g_HSI2CBuf, 9); + ret = HS_IIC_Send_Cmd(g_HSI2CBuf, 9); if(0 == HS_IIC_Recv_Resp(abyVer, 8)) { if((abyVer[0] == 'V') && (abyVer[2] == '.')) { - return ; + return ret; } } } - return ; + return ret; }