stm32 printf 重定向
https://www.digikey.cn/zh/forum/t/topic/2855
#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(&huart?, (uint8_t *)&ch, 1, HAL_MAX_DELAY); //? 为uart编号
return ch;
}

浙公网安备 33010602011771号