重定向很简单:以串口5为例,我正在这样用
#include
int fputc(int ch, FILE *f)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */
UARTCharPut(UART5_BASE, (char)ch);
return ch;
}
printf就可以随便用了,不过感觉速度不是很快。
详情回复
发表于 2014-8-6 15:18
int fputc(int ch, FILE *f)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */
UARTCharPut(UART5_BASE, (char)ch);