| | |
| | | |
| | | if (LL_USART_IsActiveFlag_RXNE(USART1)) |
| | | { |
| | | Uart1BaudGot=1; |
| | | Uart1BaudFirstGot=1; |
| | | Uart1Stat.RXNECount++; |
| | | // Uart1BaudGot=1; |
| | | // Uart1BaudFirstGot=1; |
| | | // Uart1Stat.RXNECount++; |
| | | unsigned char ch=LL_USART_ReceiveData8(USART1); |
| | | // PushOne(&Uart1Stat.QRx,ch); |
| | | Uart1Stat.RecvBytes++; |
| | | Uart1RecvBuf1[Uart1RecvBuf1DataLen++]=ch; |
| | | Uart1RecvBuf1[Uart1RecvBuf1DataLen]=ch; |
| | | if (Uart1RecvBuf1DataLen <RX1BUFSIZE -1 ) { |
| | | Uart1RecvBuf1DataLen++; |
| | | } |
| | | //LL_USART_TransmitData8(USART1,ch); |
| | | } |
| | | if (LL_USART_IsActiveFlag_ORE(USART1)) |
| | | { |
| | | LL_USART_ClearFlag_ORE(USART1); |
| | | LL_USART_DisableOverrunDetect(USART1); |
| | | Uart1Stat.OverRunCount++; |
| | | } |
| | | if (LL_USART_IsEnabledIT_IDLE(USART1)&&LL_USART_IsActiveFlag_IDLE(USART1)) |
| | |
| | | if (LL_USART_IsActiveFlag_ORE(USART2)) |
| | | { |
| | | LL_USART_ClearFlag_ORE(USART2); |
| | | LL_USART_DisableOverrunDetect(USART2); |
| | | Uart2Stat.OverRunCount++; |
| | | } |
| | | if (LL_USART_IsEnabledIT_IDLE(USART2)&&LL_USART_IsActiveFlag_IDLE(USART2)) |
| | |
| | | { |
| | | /* USER CODE BEGIN USART3_6_IRQn 0 */ |
| | | |
| | | if (LL_USART_IsActiveFlag_RXNE(USART3)) |
| | | { |
| | | unsigned char ch=LL_USART_ReceiveData8(USART3); |
| | | // Uart3Stat.RXNECount++; |
| | | // Uart3Stat.RecvBytes++; |
| | | if (Uart3RecvBuf1DataLen < UART3RXBUFSIZE -1) { |
| | | Uart3RxBuf[Uart3RecvBuf1DataLen++]=ch; |
| | | } |
| | | } |
| | | if (LL_USART_IsActiveFlag_TXE(USART3)) |
| | | { |
| | | if (Uart3SentLen >= Uart3ToSendLen) |
| | | { |
| | | Uart3SentLen = 0; |
| | | Uart3ToSendLen = 0; |
| | | LL_USART_DisableIT_TXE(USART3); |
| | | }else |
| | | { |
| | | unsigned char ch=Uart3TxBuf[Uart3SentLen++]; |
| | | LL_USART_TransmitData8(USART3,ch); |
| | | } |
| | | } |
| | | if (LL_USART_IsActiveFlag_ORE(USART3)) |
| | | { |
| | | LL_USART_ClearFlag_ORE(USART3); |
| | | LL_USART_DisableOverrunDetect(USART3); |
| | | // Uart3Stat.OverRunCount++; |
| | | } |
| | | if (LL_USART_IsEnabledIT_IDLE(USART3)&&LL_USART_IsActiveFlag_IDLE(USART3)) |
| | | {//接收完成 |
| | | LL_USART_ClearFlag_IDLE(USART3); |
| | | Uart3RecvDone(); |
| | | } |
| | | if (LL_USART_IsActiveFlag_TC(USART3)) |
| | | {//发送完成 |
| | | LL_USART_ClearFlag_TC(USART3); |
| | | Uart3SendDone(); |
| | | } |
| | | |
| | | if (LL_USART_IsActiveFlag_RXNE(USART5)) |
| | | { |
| | | unsigned char ch=LL_USART_ReceiveData8(USART5); |
| | | // Uart5Stat.RXNECount++; |
| | | // Uart5Stat.RecvBytes++; |
| | | if (Uart5RecvBuf1DataLen < RX5BUFSIZE -1) { |
| | | if (Uart5RecvBuf1DataLen < UART5RXBUFSIZE -1) { |
| | | Uart5RxBuf[Uart5RecvBuf1DataLen++]=ch; |
| | | } |
| | | } |
| | |
| | | unsigned char ch=LL_USART_ReceiveData8(USART6); |
| | | // Uart6Stat.RXNECount++; |
| | | // Uart6Stat.RecvBytes++; |
| | | if (Uart6RecvBuf1DataLen < RX6BUFSIZE -1) { |
| | | if (Uart6RecvBuf1DataLen < UART6RXBUFSIZE -1) { |
| | | Uart6RxBuf[Uart6RecvBuf1DataLen++]=ch; |
| | | } |
| | | } |