stm32103变量数据位置不一样会出错
#define USART_REC_LEN 200 //定义最大接收字节数 200u8Pc_busyflag=0;//发送是否忙标志
u16 Pc_sendlen=0; //发送长度
u16 Pc_send_cnt=1;//发送计数
u8Pc_ok_flg;
u8Pc_tx_buf;//当。。。。。。。。。。。。。。。。。。。。。。。。。。。。
//u8USART_TX_BUF; //发送缓冲,最大USART_REC_LEN个字节.
#define USART_RX_LEN 200
u8 Pc_rx_buf;
u8Pc_rx_sta=0;
u16 Pc_RxLen;
u8 Pc_ok_flg;
//备份
u8Pc_rx_buf1;
u16 Pc_RxLen1;
u16 checksum;
当Pc_tx_buf定义在这里的时候
memcpy(Pc_tx_buf,pData,buflen);
给数据他的时候有三个字节不对了
当这样定义的时候就对了
#define USART_REC_LEN 200 //定义最大接收字节数 200
u8Pc_busyflag=0;//发送是否忙标志
u16 Pc_sendlen=0; //发送长度
u16 Pc_send_cnt=1;//发送计数
u8Pc_ok_flg;
//u8USART_TX_BUF; //发送缓冲,最大USART_REC_LEN个字节.
#define USART_RX_LEN 200
u8 Pc_rx_buf;
u8Pc_rx_sta=0;
u16 Pc_RxLen;
u8 Pc_ok_flg;
//备份
u8Pc_rx_buf1;
u16 Pc_RxLen1;
u16 checksum;
u8Pc_tx_buf;//、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
页:
[1]