#include "usart.h" int fputc(int ch,FILE *f) { //采用轮询方式发送1字节数据,超时时间设置为无限等待 HAL_UART_Transmit(&huart2,(uint8_t *)&ch,1,HAL_MAX_DELAY); return ch; }