#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(&huart1,(uint8_t*)&ch,1,0xFFFF); return ch; }
printf("测试串口打印/r/n");
原文:https://www.cnblogs.com/KaiW/p/15041630.html