增加休眠日志 1533/6
authorhcj <1224667075@qq.com>
Thu, 19 Dec 2024 10:27:44 +0000 (18:27 +0800)
committerhcj <1224667075@qq.com>
Thu, 19 Dec 2024 10:27:44 +0000 (18:27 +0800)
code/sdk/application/brandy/brandy_standard/thread_init.c
code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp

index c180a96..f0d7f8b 100755 (executable)
@@ -79,6 +79,8 @@
 #include "auto_ota_service.h"
 #endif
 
+#include "custom_save_runtime.h"
+
 #define EMMC_BASE_ADDR              0x52062000
 
 #define TASK_COMMON_APP_DELAY_MS    5000
@@ -286,6 +288,14 @@ static void print_system_sleep_info(void)
     oml_pf_log_print4(LOG_BCORE_PLT_DRIVER_REBOOT, LOG_NUM_DRIVER_LPC, LOG_LEVEL_INFO,
         "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);
+
+    uapi_save_runtime_log(RUNTIME_LOG_lOW_POWER_MIN|sleep_info->sleep_veto.last_veto_id);
+
 #endif
 }
 
index 18100ac..7f28095 100644 (file)
@@ -643,6 +643,7 @@ void send_singlefile_end_cmd(void)
     timerOut_count=DEFAULT_TIMEOUT_TIME;
     cat1_ota_send_data(CAT1_TCP_SEND_SINGLE_FINESH,NULL,0,NULL);
 }
+uint32_t cat1_file_size=0;
 void send_file_pack_data(void) 
 {
     if(fp == NULL){
@@ -653,6 +654,12 @@ void send_file_pack_data(void)
     read_size = fread(data_arr+6,1,READ_FILE_DATA_MAX_SIZE,fp);
     printf("strlen(data_arr) %d read_size:%d\r\n",strlen(data_arr+6),read_size);
     if(read_size != 0){
+        cat1_file_size+=read_size;
+        if(read_size!=READ_FILE_DATA_MAX_SIZE)
+        {
+            printf("发送文件大小为%d\n",cat1_file_size);
+            cat1_file_size=0;
+        }
         send_cur_pack_data();
     }else{ //文件内容读完下一个文件内容读取
         fclose(fp);
@@ -852,7 +859,7 @@ static int udp_packet_parse(char *rx_buffer, int len)
         msg_buffer_len = msg->length;
         cmd = get_int8_from_ascii_char(rx_buffer[1]);
     }
-    printf("cmd! %d",cmd);
+    printf("TCP udp_packet_parse cmd! %d",cmd);
     noreplayCount = 0;
     if(cat1_ota_flag == CAT1_TCP_STOP_OTA) //只有在传输文件才生效
     {