环境:gcc for arm编译,使用newlib1.4.1库函数,无操作系统,欲实现全功能的printf函数和scanf函数,输出输入都用串口,或者输出用串口输入用键盘,哪位大侠知道怎么做的,请指点一二。
共4条
1/1 1 跳转至页

#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
以上头文件具体需要哪个我不记得。ARM的编译器。
void Uart_Printf(char *fmt,...)
{
va_list ap;
char string[256];
va_start(ap,fmt);
vsprintf(string,fmt,ap);
Uart_SendString(string);
va_end(ap);
}
这样Uart_Printf和printf的参数格式是一样的。
共4条
1/1 1 跳转至页