在对USART初始化后,每次上电发送的第一个数据总没有,后续的数据全部正常,是否还需要对哪个标志位进行配置呢? 初始化代码 /* USART5 mode config */ USART_InitStructure.USART_BaudRate = 9600; //115200 USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No ; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(UART5, &USART_InitStructure); USART_Cmd(UART5, ENABLE); 发送 代码 USART_SendData(UART5 , shuju); while( USART_GetFlagStatus(UART5, USART_FLAG_TC) == RESET ); |