血压串口调整
authorp15692025051 <846603105@qq.com>
Fri, 23 Feb 2024 06:59:20 +0000 (14:59 +0800)
committerp15692025051 <846603105@qq.com>
Fri, 23 Feb 2024 06:59:20 +0000 (14:59 +0800)
2.sdk/sdk/product/craneg_modem/hal/gps_device/src/gps_uart.c

index a7e6648..fe81910 100644 (file)
@@ -1215,7 +1215,8 @@ int uart4_recv_data(char *buf,int buf_max_len,unsigned int timeout)
        //cplog_printf("uart4_recv_data:timeout:%d\n",timeout);
        while(1)
        {
-               timeout--;
+               if(timeout > 0)
+                       timeout--;
                
                gps_ui_delay_us(1400);//1ms
                //UOS_SleepMs(1);
@@ -1225,7 +1226,7 @@ int uart4_recv_data(char *buf,int buf_max_len,unsigned int timeout)
                }else
                        count = 0;
                uart4_rx_buf_len_tmp = uart4_rx_buf_len;
-               if(timeout == 0 && count> 15)//连续15ms没新数据,认为是一帧数据,退出
+               if((timeout == 0 && count> 15) || (timeout == 0 && uart4_rx_buf_len == 0))//连续15ms没新数据,认为是一帧数据,退出
                        break;
                // if(count > 15)//连续15ms没新数据,认为是一帧数据,退出
                //      break;