/* awinic:set mode "Receiver"/"Music", "aw_params.h" contains id information */
if (aef_profile == UAPI_SND_AEF_PROFILE_VOIP) {
/* awinic:set mode "Receiver" */
- // ret = aw883xx_set_profile_byname(AW_DEV_0, "Receiver");
- ret = aw883xx_set_profile_byname(AW_DEV_0, "Music"); //所有通路用同一套参数。解决打电话音量小的问题。
+ ret = aw883xx_set_profile_byname(AW_DEV_0, "Receiver");
+ // ret = aw883xx_set_profile_byname(AW_DEV_0, "Music"); //所有通路用同一套参数。解决打电话音量小的问题。
} else {
/* awinic:set mode "Music" */
ret = aw883xx_set_profile_byname(AW_DEV_0, "Music");
\r
if (curTime.tm_sec % 3 == 0) {\r
do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_BLE_ADV_CHECK, nullptr, 0);\r
+ do_cywee_service_check_msg(CYWEE_SERVICE_CMD_CHECK_ACC,NULL); //检查gsensor是否停止\r
}\r
\r
if (g_alarmCtrA.state == ALARM_STATUS_RUNNING)\r
void cywee_custom_save_sleep_data(void);
void cywee_custom_save_nap_data(void);
void cywee_reset_history_daily_data(void);
-
+void cywee_check_acc(void);
#pragma pack()
* @Author: penglei 1624952103@qq.com
* @Date: 2024-03-26 20:29:58
* @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-08-16 15:46:30
+ * @LastEditTime: 2024-10-28 20:02:18
* @FilePath: /FD230/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h
* @Description:
*
#define CYWEE_SERVICE_CMD_RESTART_ACC 0x35
+#define CYWEE_SERVICE_CMD_CHECK_ACC 0x36
+
errcode_t uapi_cywee_service_init(void);
void uapi_cywee_service_deinit(void);
case CYWEE_SERVICE_CMD_RESTART_ACC:
cywee_restart_acc();
break;
+
+ case CYWEE_SERVICE_CMD_CHECK_ACC:
+ cywee_check_acc();
+ break;
default:
PRINT("unkonw cmd \r\n");
break;
static uint8_t wear_status = 0;//佩戴状态
+static uint8_t timeout = 0;
+
#ifdef CYWEE_MAC_ACTIVE
int cm__hs1__mac_c1_init(void);
int cm__hs1__deinit(void);
int cm__hs1__deinit(void);
#endif
+void cywee_check_acc(void)
+{
+ if(!timeout)
+ {
+ cywee_restart_acc();
+ }
+ else
+ {
+ timeout = 0;
+ }
+}
void clean_sleep_data(void)
{
}
else if(sleep_stat[stat_num].stat == 4)
{
+ //目前cywee出睡时间戳有bug 暂时先用系统时间戳
+ uapi_get_timestampe_ss(×tamp);
+ sleep_stat[stat_num].timestamp = timestamp;
wake_up_timestamp = sleep_stat[stat_num].timestamp;
sleep_update_timestamp = wake_up_timestamp;
}
void cywee_restart_acc(void)
{
+ uint32_t tm = 0;
+ uapi_get_timestampe_ss(&tm);
+ CWM_OS_dbgPrintf("cywee_restart_acc : %d \n",tm);
memset(&scl, 0, sizeof(scl));
scl.iData[0] = 1;
scl.iData[1] = 1;
cywee_inactivity_result_t c_inactivity_result_t;
cywee_inactivity_accumulate_time_t c_inactivity_accumulate_time_t;
cywee_activity_result_extre_info_t c_activity_result_extre_info_t;
-
+ uint32_t tm = 0;
switch (sensorEVT->sensorType) {
case IDX_ACCEL:
gxyz_t.x = sensorEVT->fData[0];
}else if((int)sensorEVT->fData[0] == 102)
{
- CWM_OS_dbgPrintf("ar alert type : %d\n",(int)sensorEVT->fData[1]);
+ uapi_get_timestampe_ss(&tm);
+ CWM_OS_dbgPrintf("ar alert type : %d tm :%d \n",(int)sensorEVT->fData[1],tm);
int ar_alert_type = (int)sensorEVT->fData[1];
CustomEventPublish(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE,&ar_alert_type,sizeof(int));
//设置抬腕功能
memset(&scl, 0, sizeof(scl));
scl.iData[0] = 1;
- // scl.iData[1] = 5;
- // scl.iData[2] = 5;
- // scl.iData[3] = 5;
- // scl.iData[4] = 5;
+ scl.iData[1] = 6;
+ scl.iData[2] = 5;
+ scl.iData[3] = 5;
+ scl.iData[4] = 4;
CWM_SettingControl(SCL_HAND_UPDOWN_CONFIG, &scl);
//配置跑步机模式相关参数(进入跑步机模式自动生效)
void cywee_int_handler(void)
{
+ timeout = 1;
// if(cywee_switch == 1)
{
#ifdef AP_ENABLE_DML_SDO_LISTEN
const int32_t spo2_ir_wear_thres = 10000;\r
const uint8_t spo2_ir_wear_offset = 15;\r
//CHECK_WEAR_MODE_THRES\r
-const int32_t check_mode_unwear_thre = 8000;\r
-const int32_t check_mode_wear_thre = 10000;\r
+const int32_t check_mode_unwear_thre = 25000;\r
+const int32_t check_mode_wear_thre = 30000;\r
\r
\r
uint8_t alg_ram[11 * 1024] __attribute__((aligned(4)));\r
\r
static uint8_t hx3695_chip_id = 0;\r
\r
-static int timeout = 0;\r
+// static int timeout = 0;\r
\r
//////// spo2 para and switches\r
const uint8_t COUNT_BLOCK_NUM = 25; //delay the block of some single good signal after a series of bad signal\r
\r
static uint8_t his_wear = 2;\r
static uint8_t wear_cnt = 0;\r
-static uint8_t acc_restart_flag = 0;\r
+// static uint8_t acc_restart_flag = 0;\r
\r
void hx3695_hrs_ppg_Int_handle(void)\r
{\r
\r
for(ii=0; ii<*count; ii++)\r
{\r
- if(gsensordata[ii].x == 0.0f && gsensordata[ii].y == 0.0f && gsensordata[ii].z == 0.0f)\r
- {\r
- timeout++;\r
- if(timeout > 20 && !acc_restart_flag) //避免重复开关gsensor\r
- {\r
- do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESTART_ACC,NULL);\r
- acc_restart_flag = 1;\r
- }\r
- }\r
- else\r
- {\r
- timeout = 0;\r
- acc_restart_flag = 0;\r
- }\r
+ // if(gsensordata[ii].x == 0.0f && gsensordata[ii].y == 0.0f && gsensordata[ii].z == 0.0f)\r
+ // {\r
+ // timeout++;\r
+ // if(timeout > 20 && !acc_restart_flag) //避免重复开关gsensor\r
+ // {\r
+ // do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESTART_ACC,NULL);\r
+ // acc_restart_flag = 1;\r
+ // }\r
+ // }\r
+ // else\r
+ // {\r
+ // timeout = 0;\r
+ // acc_restart_flag = 0;\r
+ // }\r
if(ii == 8)\r
{\r
gsen_fifo_x_send[ii] = gsen_fifo_x_send[ii - 1];\r