码迷,mamicode.com
首页 > 其他好文 > 详细

重定向printf

时间:2018-02-08 00:30:29      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:pos   utc   blog   int   tchar   prototype   clu   nbsp   gnu   

#include "stdio.h"

#ifdef __GNUC__
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif 
PUTCHAR_PROTOTYPE
{
HAL_UART_Transmit(&huart2 , (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}

重定向printf

标签:pos   utc   blog   int   tchar   prototype   clu   nbsp   gnu   

原文地址:https://www.cnblogs.com/zhaogaojian/p/8428680.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!