休眠日志修改 1533/7 1533/head
authorhcj <1224667075@qq.com>
Thu, 19 Dec 2024 10:45:21 +0000 (18:45 +0800)
committerhcj <1224667075@qq.com>
Thu, 19 Dec 2024 10:45:21 +0000 (18:45 +0800)
code/sdk/application/brandy/brandy_standard/thread_init.c
code/sdk/drivers/peripheral/utils/custom_save_runtime.h

index f0d7f8b..618853b 100755 (executable)
@@ -256,6 +256,10 @@ void thread_init(void)
         }
     }
 }
+#if ENABLE_LOW_POWER == YES
+    static uint32_t last_sys_slp=0x0;
+    static bool last_m_core_sleep=false;
+#endif
 
 static void print_system_sleep_info(void)
 {
@@ -289,12 +293,29 @@ static void print_system_sleep_info(void)
         "App run time:%d, app deepsleep time:%d, lightsleep time:%d, m sleep flag:%d",
         (uint32_t)los_system_system_run_time(), deepsleep_time, lightsleep_time, (uint8_t)m_core_sleep);
 
-    if(m_core_sleep)
-    uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_M_SLEEP);
-    else
-    uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_MIN);
+    if(last_m_core_sleep!=m_core_sleep)
+    {
+        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);
+
+        last_m_core_sleep=m_core_sleep;
+    }
+
+    if(last_sys_slp!=sys_slp)
+    {
+        if(sys_slp)
+        uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_SYS_SLEEP);
+        else
+        uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_NO_SYS_SLEEP);
+
+        last_sys_slp=sys_slp;
+    }
+    
+  
 
-    uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_MIN|sleep_info->sleep_veto.last_veto_id);
+    // uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_MIN|sleep_info->sleep_veto.last_veto_id);
 
 #endif
 }
index b0bdb91..b5537c3 100644 (file)
@@ -190,7 +190,10 @@ typedef enum {
 
   //低功耗记录
     RUNTIME_LOG_lOW_POWER_MIN = 0x1000,
-    RUNTIME_LOG_lOW_POWER_M_SLEEP=0x10ff,
+    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_RECORD_MIN = 0x1100,
   RUNTIME_LOG_RECORD_START,    // 0x1101 录音开始