#include "ppg_service.h"
#endif
+#include "cywee_service.h"
+
#define AP_ENABLE_DML_SDO_LISTEN
#define GSENSON_MSG_COUNT 64
#define SLEEP_STATUS_LENGTH 50
static uint32_t last_fat_burn_timestamp = 0; // 上次燃脂状态更新的时间戳
static int last_mhr_zone = -1; // 上次的心率区间状态
+static uint8_t is_free_trainning_mode = 0;
+
/**
* @brief 更新燃脂时间
* @param current_mhr_zone 当前心率区间 (2表示燃脂区间)
}
static void cywee_service_check_timer_callback(void)
+{
+ // cywee_hrs_update();
+ // cywee_gnss_update();
+ do_cywee_service_check_msg(CYWEE_SERVICE_CMD_DATA_UPDATE, NULL);
+}
+
+void cywee_service_data_update(void)
{
cywee_hrs_update();
cywee_gnss_update();
else
cywee_sport_timer_stop_check();
+ if(mode == SPORT_ACTIVE_MODE_FREE_TRAINING)
+ is_free_trainning_mode = 1;
+ else
+ is_free_trainning_mode = 0;
+
switch (mode)
{
c_act_ext_result_t.MHR_zone = (int)sensorEVT->fData[13];
c_act_ext_result_t.distance_motion = (int)sensorEVT->fData[14];
+ // CWM_OS_dbgPrintf("MHR_zone:%d\n",c_act_ext_result_t.MHR_zone);
+
// 燃脂时间计算:当MHR_zone = 2时表示燃脂状态
- update_fat_burn_time(c_act_ext_result_t.MHR_zone);
+ if(!is_free_trainning_mode)
+ update_fat_burn_time(c_act_ext_result_t.MHR_zone);
// cywee_func(CYWEE_MSG_TYPE_ACTIVITY_EXTRA_INFO_UPDATE,&c_act_ext_result_t,sizeof(act_ext_result_t));
//CustomEventPublish(TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE, &c_act_ext_result_t, sizeof(act_ext_result_t));
c_act_result_t.duration = (int)sensorEVT->fData[5];
c_act_result_t.MHR_zone = (int)sensorEVT->fData[6];
+ // CWM_OS_dbgPrintf("MHR_zone:%d\n",c_act_result_t.MHR_zone);
+
// 燃脂时间计算:当MHR_zone = 2时表示燃脂状态
update_fat_burn_time(c_act_result_t.MHR_zone);
* @Author: penglei 1624952103@qq.com
* @Date: 2024-03-26 20:29:58
* @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2025-07-30 09:44:07
+ * @LastEditTime: 2025-10-30 11:10:43
* @FilePath: /FD230/code/sdk/drivers/peripheral/cywee/Inc/cywee_service.h
* @Description:
*
#define CYWEE_SERVICE_CMD_CHECK_ACC 0x36
+#define CYWEE_SERVICE_CMD_DATA_UPDATE 0X37
+
errcode_t uapi_cywee_service_init(void);
void uapi_cywee_service_deinit(void);