源码相关:
int fputc (int ch, FILE *f) { return (USART1_SendChar(ch)); }
int fgetc(FILE * file) { return (USART1_GetKey()); }
void main_test(void)
{
while (1)
{
fgets(tmpbuf,12,NULL_T);// 串口接收字符串 OK
fputs(tmpbuf,NULL_T);// 串口发送字符串 OK
}
}
发送 123456789加换行
调试结果:
581257
258
135836815836958247
47
68135789
123456789
要发送一百多个字节后才能开始正确的收发数据,哪位知道是什么问题?