高级会员

- 积分
- 523
- 金钱
- 523
- 注册时间
- 2016-1-11
- 在线时间
- 132 小时
|

楼主 |
发表于 2017-3-21 15:37:42
|
显示全部楼层
volatile u8 com1send_over ;
volatile u8 com1send_index ;
volatile u8 com1send_len ;
volatile u8 com1RecvEndTim ;
volatile u8 com1recv_over ;
volatile u8 com1recv_index ;
volatile u8 com1recv_state ;
if(USART_GetITStatus(USART1, USART_IT_TC) != RESET)
{
USART_ClearITPendingBit(USART1,USART_IT_TC);
USART_ClearFlag(USART1,USART_FLAG_TC);
if(com1send_over==0)
{
//·¢Ëí1×Ö½ú
if(com1send_index>=response.PDUByteLen)//ÅD¶ÏòÑ·¢ËíμÄ×Ö½úêy
{
com1send_over=1;//·¢Ëííê3é±êÖ¾
RS485_LOW;//RS485TC=0;//×¼±¸½óêü
com1rs485tc=0;
com1send_index=1;
com1send_over=0; //·¢Ëí½áêø
com1send_index=1; //·¢ËíË÷òy
com1send_len =0; //·¢Ëí3¤¶è
com1RecvEndTim=0;
com1recv_over=0; //½óêÕ½áêø
com1recv_state=0;
com1recv_index=0; //½óêÕË÷òy
}
else//¼ìDø·¢Ëí
{
if(com1send_index<response.PDUByteLen)
{
USART1->DR=response.PDUDataptr[com1send_index++];//UART2_SendData8()
}
else
{
com1send_over=1;
RS485_LOW;//RS485TC=0;//×¼±¸½óêü
com1rs485tc=0;
com1send_index=1;
com1recv_over=0;
}
}这是发送的代码。这些是定义了一个u8的一些数啊。这和485扯上啥关系了? |
|