Browse Source

Uart重启问题未解决,暂时先跳过。但存在进入睡眠时被重启。!!!

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
a844a6ef14
1 changed files with 2 additions and 16 deletions
  1. 2 16
      src/UartTask.c

+ 2 - 16
src/UartTask.c

@@ -387,7 +387,7 @@ UINT8 Uart_DataRecv_func(UINT8* Uart_Read_Msg,UINT8* Uart_Recv_Buffer)
     *(Uart_Read_Msg+6) = CRC_chk_buffer;
     *(Uart_Read_Msg+7)  = CRC_chk_buffer>>8;
     USARTdrv->Send(Uart_Read_Msg,8);
-    #ifdef USING_PRINTF1
+    #ifdef USING_PRINTF
         printf("Uart_Send_buffer:  ");
         for(int i=0;i<8;i++)
         {
@@ -396,17 +396,6 @@ UINT8 Uart_DataRecv_func(UINT8* Uart_Read_Msg,UINT8* Uart_Recv_Buffer)
         printf("\n");
     #endif
     USARTdrv->Receive(Uart_Recv_Buffer,Data_Len);
-    // while((isRecvTimeout == false) && (isRecvComplete == false))
-    // {
-    //     timeout++;
-    //     osDelay(100);
-    //     if (timeout>=50)
-    //     {
-    //         timeout =0;
-    //         isRecvTimeout = true;
-    //         break;
-    //     }
-    // }
 	while(true)
     {
         
@@ -418,16 +407,13 @@ UINT8 Uart_DataRecv_func(UINT8* Uart_Read_Msg,UINT8* Uart_Recv_Buffer)
         }
         else
         {
-
             osDelay(100);
             if (timeout>=50)
             {
                 timeout =0;
                 isRecvTimeout = true;
-                //break;
             }
-        }
-            
+        } 
     }
 	#ifdef USING_PRINTF  
              printf("%s[%d]\r\n",__FUNCTION__, __LINE__);