#include "debug_print.h"
#include "custom_utils.h"
#include <math.h>
+#include "custom_save_runtime.h"
#define HAL_ADC_SAMPLE_NUMBER_CONFIG_0 10 /* Channel with buffer manual sample average number. */
#define HAL_ADC_SAMPLE_NUMBER_CONFIG_1 10 /* Channel without buffer manual sample average number. */
// else if(percent > history_percent && history_percent && abs(history_percent - percent) < 10)
else if(percent > history_percent && history_percent)
{
+ uapi_save_runtime_log(RUNTIME_LOG_BATTERY_MIN_UP);
// PRINT("2222 charge percent[%d], history_percent[%d] \n",percent,history_percent);
history_percent++;
percent = history_percent;
// else if(history_percent > percent && abs(history_percent - percent) < 10)
else if(history_percent > percent)
{
+ uapi_save_runtime_log(RUNTIME_LOG_BATTERY_MIN_DOWN);
// PRINT("2222 uncharge percent[%d], history_percent[%d] \n",percent,history_percent);
history_percent--;
percent = history_percent;
{
if(get_charge_stat() && history_percent < 100 && history_percent) //充电中则均匀增加
{
+ uapi_save_runtime_log(RUNTIME_LOG_BATTERY_MIN_UP);
history_percent++;
percent = history_percent;
}
if(get_battery_percent_flag == 1)
{
- if(len >= 120)
+ if(len >= 60)
+ {
+ index = 30;
+ len = 60;
+ }
+ else if(len >= 30 && len < 60)
+ index = 30;
+ else
+ return result;
+ }
+ else if(get_battery_percent_flag == 2)
+ {
+ if(len >= 90)
{
index = 60;
- len = 120;
+ len = 90;
}
- else if(len >= 60 && len < 120)
+ else if(len >= 60 && len < 90)
index = 60;
else
return result;
+ }else if(get_battery_percent_flag == 3)
+ {
+ if(len >= 120)
+ {
+ index = 90;
+ len = 120;
+ }
+ else if(len >= 90 && len < 120)
+ index = 90;
+ else
+ return result;
+ }else if(get_battery_percent_flag == 4)
+ {
+ if(len >= 150)
+ {
+ index = 120;
+ len = 150;
+ }
+ else if(len >= 120 && len < 150)
+ index = 120;
+ else
+ return result;
}
- else if(get_battery_percent_flag == 2)
+ else if(get_battery_percent_flag == 5)
{
if(len >= 180)
{
- index = 120;
+ index = 150;
len = 180;
}
- else if(len >= 120 && len < 180)
- index = 120;
+ else if(len >= 150 && len < 180)
+ index = 150;
else
return result;
}
else
{
- if(len >= 60)
- len = 60;
+ if(len >= 30)
+ len = 30;
}
for(int i = index; i < len; i++)
{
}
std::ostringstream oss;
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "data[%d].voltage : %f , data[%d].percent : %d",i,data[i].voltage,i,data[i].percent);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "data[%d].voltage : %f , data[%d].percent : %d",i,data[i].voltage,i,data[i].percent);
if(data[i].stat)
// charge_stat = static_cast<int>(i) + ":充电中";
}
else if(get_battery_percent_flag == 2)
{
- nextorprepageLabelButton->SetText("第一页");
+ nextorprepageLabelButton->SetText("第四页");
get_battery_percent_flag = 3;
}
+ else if(get_battery_percent_flag == 3)
+ {
+ nextorprepageLabelButton->SetText("第五页");
+ get_battery_percent_flag = 4;
+ }
+ else if(get_battery_percent_flag == 4)
+ {
+ nextorprepageLabelButton->SetText("第六页");
+ get_battery_percent_flag = 5;
+ }
+ else if(get_battery_percent_flag == 5)
+ {
+ nextorprepageLabelButton->SetText("第一页");
+ get_battery_percent_flag = 6;
+ }
else
{
nextorprepageLabelButton->SetText("第二页");
#include "ConfigModelC.h"
#include "battery_hal.h"
#include "sleep/include/SleepModelC.h"
+#include "custom_save_runtime.h"
#define AP_ENABLE_DML_SDO_LISTEN
#define WEAR_FILE_COUNT 50
+
static gsenson_t gxyz_t;
static uint8_t gsenson_falg=0;
{
send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_PPG_TEST);
hrs_mode_state = 1;
+ uapi_save_runtime_log(RUNTIME_LOG_HEART_SPORT_MEASURE);
}
else
{
send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST);
hrs_mode_state = 0;
+ uapi_save_runtime_log(RUNTIME_LOG_OXYGEN_SPORT_MEASURE_END);
}
}
{
// CWM_OS_dbgPrintf("[cwyee] turn_off_screen \n");
mmi_screen_on_off_by_flip_wrist(false);
+ uapi_save_runtime_log(RUNTIME_LOG_RAISE_MIN_DOWN);
}
#endif
}else if ((int)sensorEVT->fData[1] == 1)
{
#if defined(SUPPORT_POWER_MANAGER)
// CWM_OS_dbgPrintf("[cwyee] turn_on_screen \n");
- mmi_screen_on_off_by_flip_wrist(true);
+ mmi_screen_on_off_by_flip_wrist(true);
+ uapi_save_runtime_log(RUNTIME_LOG_RAISE_MIN_UP);
#endif
}
break;
{
send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_PPG_TEST);
hrs_mode_state = 1;
+ uapi_save_runtime_log(RUNTIME_LOG_HEART_SPORT_MEASURE);
// hrs = 0;//运动开始,清零心率
}
else
{
send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST);
hrs_mode_state = 0;
+ uapi_save_runtime_log(RUNTIME_LOG_OXYGEN_SPORT_MEASURE_END);
}
}
break;
#include "cywee_hal.h"
#include "cywee_service.h"
#include "custom_runtime.h"
+#include "custom_save_runtime.h"
static bool g_ppg_service_initialled = false;
}
if((wear_mode_state == 1) && (mail > 0x10) && mail != PPG_SERVICE_CMD_TYPE_STOP_WEAR_MODE_TEST)
{
+ uapi_save_runtime_log(RUNTIME_LOG_WEAR_MIN_STOP);
wear_mode_state = 0;
ppg_send_cmd_to_driver("wear",0);
ppg_service_running_stat = false;
enable = 1;
}else if (mail == PPG_SERVICE_CMD_TYPE_DO_WEAR_MODE_TEST){
if (keep_in_wear_det_mod == 0) continue;;
+ uapi_save_runtime_log(RUNTIME_LOG_WEAR_MIN_START);
cmd = "wear";
enable = 1;
wear_mode_state = 1;
{
if (keep_in_wear_det_mod == 1)
{
+ uapi_save_runtime_log(RUNTIME_LOG_WEAR_MIN_START);
ppg_send_cmd_to_driver("wear",1);
wear_mode_state = 1;
ppg_service_running_stat = true;
uint8_t imagqa = crown_read_reg(Img_Qa);
uint8_t pdsat = crown_read_reg(PD_SAT);
- if (imagqa<100 || imagqa > 180 || pdsat <240){
+ if (imagqa<100 || imagqa > 180 || pdsat >=240){
// TYHX_LOG("crown still not pass! pic qulity =%d (should img_qa>=100 && img_qa<=180) , pd saturation=%d (should pd_sat >=240)\r\n",imagqa,pdsat);
}
/*
*@Author:luozheng 1732036298@qq.com
*@Date:2024-12-18 10:27:52
- *@LastEditors:luozheng 1732036298@qq.com
- *@LastEditTime:2024-12-18 16:53:11
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-12-19 18:17:33
*@FilePath:/FD230/code/sdk/drivers/peripheral/utils/custom_save_runtime.h
*/
/**
RUNTIME_LOG_HEART_PASSIVE_MEASURE,
//被动测量心率结束
RUNTIME_LOG_OXYGEN_PASSIVE_MEASURE_END,
+ //运动测量心率开始或继续
+ RUNTIME_LOG_HEART_SPORT_MEASURE,
+ //运动测量心率暂停或结束
+ RUNTIME_LOG_OXYGEN_SPORT_MEASURE_END,
/*******************************/
//佩戴
RUNTIME_LOG_WEAR_MIN = 0x0600,
+ RUNTIME_LOG_WEAR_MIN_START = 0x0601,
+ RUNTIME_LOG_WEAR_MIN_STOP = 0x0602,
/*******************************/
//血氧
RUNTIME_LOG_LCD_OFF, // 0x0802 屏幕灭
//抬腕
RUNTIME_LOG_RAISE_MIN = 0x0900,
+ RUNTIME_LOG_RAISE_MIN_UP = 0x0901,
+ RUNTIME_LOG_RAISE_MIN_DOWN = 0x0902,
//充电
RUNTIME_LOG_CHARGE_MIN = 0x0A00,
//电池电量变化
RUNTIME_LOG_BATTERY_MIN = 0x0B00,
+ RUNTIME_LOG_BATTERY_MIN_UP = 0x0B01,
+ RUNTIME_LOG_BATTERY_MIN_DOWN = 0x0B02,
//马达
RUNTIME_LOG_MOTOR_MIN = 0x0C00,
/*
* @Author: penglei 1624952103@qq.com
* @Date: 2024-08-08 16:33:23
- * @LastEditors: SnickerSun snickersun@163.com
- * @LastEditTime: 2024-11-20 16:45:27
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-12-19 18:04:22
* @FilePath: /FD230/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp
* @Description:
*
#include "custom_utils.h"
#include "custom_runtime.h"
#include "../../../../../drivers/peripheral/config/include/ConfigModelC.h"
+#include "custom_save_runtime.h"
void custom_VibratorFunc_int(int vibratorType)
{
-
+ uapi_save_runtime_log(RUNTIME_LOG_MOTOR_START);
+
//忽略系统调用参数,只按照configmodel里保存的值来震动
uint8_t vibmod=uapi_dev_runtime_get_vibmod();
vibrator_cmd_t mail = {0};