huixiesui 发表于 2015-12-19 12:58
我从ST AC6 下载集成了这个ECLIPSE编译器,但是不能实现printf() ,以前用keil 选择了 micro LIB,可以使 ...
试试重定向printf()
...
#undef __GNUC__
#ifdef __GNUC__
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif
...
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
使用eclipse+gcc编译的,请注释掉重定向printf()时的:
#undef __GNUC__
一步步写得很详细,或许用得上 赞一个真不错 谢谢!谢谢! 期待 ,谢谢分享 赞一个
页:
1
[2]