摘要: ## 前言 ##借调试宏的设计,梳理下宏的用法## 重定向printf打印 ##嵌入式设备基本会配置RS232串口作为调试IO接口,假设底层串口单字节输出函数为SERIAL_PutChar(),利用fputc()和fputs()重定向printf函数 ```cppvoid fputc(int byte, FILE* stream){ (void)stream; SERIAL_PutChar(byte);}void fputs(const char *pstr, FILE *stream){ (void)stream; while(*pstr) { SERIAL_PutChar(*pstr++. 阅读全文
posted @ 2014-03-30 22:01 qkshan 阅读(476) 评论(1) 推荐(0) 编辑