更新
authorp15692025051 <846603105@qq.com>
Fri, 22 Aug 2025 04:00:44 +0000 (12:00 +0800)
committerp15692025051 <846603105@qq.com>
Fri, 22 Aug 2025 04:00:44 +0000 (12:00 +0800)
2.code/1.sdk/apps/BK_app/BK_drive/bk_uart.c

index 5517ced..9eee113 100644 (file)
@@ -16,6 +16,7 @@
 int ut=0;
 OS_SEM uart_callback;
 char read_ack_flag= 0;
+char ota_flag = 0;
 static int uart_data_len = 0;
 static char *uart_data  =NULL;
 static char *uart_dma_buf =NULL;
@@ -813,10 +814,14 @@ void UART_event(void){
 }
 static void get_ble_switch_imei_timer_cb(void *priv)
 {
+    if(ota_flag!=0)
+        return;
     bk_app_send_smg(UART_EVENT,NULL,0);
 }
 void get_ble_switch_imei_timer_init(void)
 {
+    if(ota_flag!=0)
+        return;
     if(get_ble_switch_timerid==0){
         get_ble_switch_timerid = sys_timer_add(NULL, get_ble_switch_imei_timer_cb, 5000); 
     }
@@ -980,10 +985,12 @@ int parse_uart_data(char *json_string)
         {
             updata_fd_open("UPDATE");
             ack_flag = 1;
+            ota_flag = 1;
             ota_data_len = 0;
         }
         if(!strcmp(event->valuestring,"ota_data"))//ota接收数据
         {
+            ota_flag = 1;
             //updata_fd_open("UPDATE");
             cJSON *update_json = cJSON_GetObjectItemCaseSensitive(root, "update");
             cJSON *offset_json = cJSON_GetObjectItemCaseSensitive(root, "offset");