关于第十一届第一场蓝桥杯中如何判断串口数据的问题的代码如下:

//USARTu8 rx_buf[3];u8 rx_cnt;u8 load_rx_buf[30];__IO uint32_t UART_Tick=0;_Bool flag=0;int fputc(int ch, FILE *f) {  HAL_UART_Transmit(&huart1,(unsigned char*)&ch,1,50);  return ch;}void UART_Process(void){if(uwTick-UART_Tick<50)return;UART_Tick=uwTick;if(rx_cnt>0&&flag==0){printf("changdu");}flag=0;rx_cnt=0;memset(load_rx_buf,'\0',sizeof(load_rx_buf));}//3.3,4.3//0123456u8 CHEK_DATA(u8 *str){if(str[3]!=','||str[1]!='.'||str[5]!='.'){printf("biaodian");return 0;}if(str[0]>'9'||str[0]<'0'||str[2]>'9'||str[2]<'0'||str[4]>'9'||str[4]<'0'||str[6]>'9'||str[6]<'0'){    printf("shuzi");return 0;}return 1;}//DATA_PROCESSfloat v_min=0;float v_max=0;void DATA_PROCESS(u8 *str){  v_min=(str[0]-'0')*1.0f+0.1f*(str[2]-'0');  v_max=(str[4]-'0')*1.0f+0.1f*(str[6]-'0');}void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart){UART_Tick=uwTick;load_rx_buf[rx_cnt++]=rx_buf[0];if(rx_cnt==7){flag=1;printf("%s\r\n",load_rx_buf);printf("7byte\r\n");rx_cnt=0;if(CHEK_DATA(load_rx_buf)==1){printf("Correct");DATA_PROCESS(load_rx_buf);}}HAL_UART_Receive_IT(&huart1,rx_buf,1);}u8 display_buf[30];void LCD_Process(void){sprintf((char*)display_buf,"v_max:%3.1f",v_max);LCD_DisplayStringLine(Line0, display_buf);sprintf((char*)display_buf,"v_min:%3.1f",v_min);LCD_DisplayStringLine(Line1, display_buf);}