增加投票记录
authorhcj <1224667075@qq.com>
Fri, 20 Dec 2024 11:35:06 +0000 (19:35 +0800)
committerhcj <1224667075@qq.com>
Fri, 20 Dec 2024 11:35:06 +0000 (19:35 +0800)
code/sdk/application/brandy/brandy_standard/thread_init.c
code/sdk/drivers/peripheral/utils/custom_save_runtime.h
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 618853b..fe95a02 100755 (executable)
@@ -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
index a1df48c..75d3b89 100644 (file)
@@ -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;
 
index 7843762..6378fd0 100644 (file)
@@ -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)
 {
index 9985ef7..13df29f 100644 (file)
@@ -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 日期格式选项枚举
  */