初级会员

- 积分
- 93
- 金钱
- 93
- 注册时间
- 2018-6-22
- 在线时间
- 19 小时
|

楼主 |
发表于 2018-6-22 16:21:05
|
显示全部楼层
while(1)
{
uint8_t Uart1_Rx_Num=0;
uint8_t Uart1_Tx_Num;
uint8_t Uart1_Sta;
uint8_t Uart1_Buffer[Uart1_Rx_Num];
if((UartHandle.Instance ->ISR |= USART_ISR_RXNE)!= RESET )
Uart1_Buffer[Uart1_Rx_Num]=UartHandle.Instance ->RDR;
Uart1_Rx_Num++;
if( Uart1_Buffer[0]==0x03)
if( Uart1_Buffer[4]==0x06)
{
HAL_Delay(200);
Uart1_Sta=0x01;
} 将接收到的数据存入Uart1_Buffer[], 读取Uart1_Buffer[0],和Uart1_Buffer[4]是否和接收的数据相同 |
|