|
发表于 2023-11-23 14:51:33
|
显示全部楼层
1、重写fputc
#if 1
#pragma import(__use_no_semihosting)
struct __FILE
{
int handle;
};
FILE __stdout;
//_sys_exit()
void _sys_exit(int x)
{
x = x;
}
//fputc
int fputc(int ch, FILE *f)
{
FL_UART_WriteTXBuff(UART0, ch);
while(FL_SET!= FL_UART_IsActiveFlag_TXBuffEmpty(UART0));
return ch;
}
#endif
2、初始化uart0
可参考例程
就可以从uart0 输出了。
要换其他uart口也 可以 |
|