From: hcj <1224667075@qq.com> Date: Fri, 20 Dec 2024 11:35:06 +0000 (+0800) Subject: 增加投票记录 X-Git-Tag: v1.3.113-repair_tp~18^2~31 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=40ebf759ce235d4d9194cc256b73716c9fd0d9d1;p=mirrors%2FFD230.git 增加投票记录 --- diff --git a/code/sdk/application/brandy/brandy_standard/thread_init.c b/code/sdk/application/brandy/brandy_standard/thread_init.c index 618853b18..fe95a022a 100755 --- a/code/sdk/application/brandy/brandy_standard/thread_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_init.c @@ -298,7 +298,12 @@ static void print_system_sleep_info(void) if(m_core_sleep) uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_M_SLEEP); else - uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_NO_M_SLEEP); + { + uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_NO_M_SLEEP); + get_save_runtime_vote_status(); + + } + last_m_core_sleep=m_core_sleep; } @@ -306,15 +311,15 @@ static void print_system_sleep_info(void) if(last_sys_slp!=sys_slp) { if(sys_slp) - uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_SYS_SLEEP); + { + uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_SYS_SLEEP_1); + get_save_runtime_vote_status(); + } else - uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_NO_SYS_SLEEP); + uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_SYS_SLEEP_0); last_sys_slp=sys_slp; } - - - // uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_MIN|sleep_info->sleep_veto.last_veto_id); #endif diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h index a1df48cd6..75d3b89e3 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h @@ -202,8 +202,8 @@ typedef enum { RUNTIME_LOG_lOW_POWER_MIN = 0x1000, RUNTIME_LOG_lOW_POWER_M_SLEEP, RUNTIME_LOG_lOW_POWER_NO_M_SLEEP, - RUNTIME_LOG_lOW_POWER_SYS_SLEEP, - RUNTIME_LOG_lOW_POWER_NO_SYS_SLEEP, + RUNTIME_LOG_lOW_POWER_SYS_SLEEP_1,//醒来 + RUNTIME_LOG_lOW_POWER_SYS_SLEEP_0,//睡 //录音 RUNTIME_LOG_RECORD_MIN = 0x1100, RUNTIME_LOG_RECORD_START, // 0x1101 录音开始 @@ -215,6 +215,7 @@ typedef enum { RUNTIME_LOG_MSG_MIN = 0x1200, //消息显示 RUNTIME_LOG_MSG_SHOW, + RUNTIME_LOG_VOTE_ID =0x1300, } runtime_log_cmd_Id; diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 784376240..6378fd08a 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -76,6 +76,7 @@ #include "battery_service.h" #include "cywee_hal.h" #include "bluetooth/include/BluetoothModelC.h" +#include "custom_save_runtime.h" errcode_t uapi_create_osThread_custom(app_task_definition_t *task_cfg) { @@ -1371,6 +1372,27 @@ errcode_t get_vote_status(char* str, size_t str_size) { return ERRCODE_SUCC; } +int get_save_runtime_vote_status(void) +{ + uint8_t i; + uint8_t flag = 0; + pm_veto_t* pm_veto_ptr = pm_veto_get_info(); + + PRINT("***************get_vote_status***************\n"); + + for (i = 0; i < PM_ID_MAX; i++) { + if (pm_veto_ptr->veto_counts.sub_counts[i]) { + + uapi_save_runtime_log(pm_veto_ptr->veto_counts.sub_counts[i]|RUNTIME_LOG_VOTE_ID); + + } else { + PRINT("vote_status: %s %d\n", get_pm_id_name(i), pm_veto_ptr->veto_counts.sub_counts[i]); + } + } + + + return ERRCODE_SUCC; +} /*系统声音设置*/ void uapi_systemVolumeSet(int32_t sounding) { diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 9985ef715..13df29fe5 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -97,6 +97,8 @@ void uapi_set_screen_on_api(void); /*获取Vote状态*/ errcode_t get_vote_status(char *str,size_t str_size); +int get_save_runtime_vote_status(void); + /** * @brief 日期格式选项枚举 */