三个串口,收的数据都是独立的,可能是我软件写的有问题,现在是本来应该串口2收,结果跑到串口3中了,在查询中这样写是不是不对?
while(1){ while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET); USART_ClearFlag(USART2, USART_FLAG_RXNE); RxBuffer2[RxCounter2++] = (USART_ReceiveData(USART3) & 0x7F); 看看这一行 while(USART_GetFlagStatus(USART3, USART_FLAG_RXNE) == RESET); USART_ClearFlag(USART3, USART_FLAG_RXNE); RxBuffer3[RxCounter3++] = (USART_ReceiveData(USART3) & 0x7F); } |