【printf】CubeMX生成MDK工程实现printf功能注意点
重定向printf
int fputc(int ch, FILE *f)
{
/* Write a character to the USART */
USART1->DR = ch;
/* Loop until the end of transmission */
while ((USART1->SR & UART_IT_TC) == RESET);
return ch;
}
MDK必须选择 MicroLIB
再牛逼的梦想也架不住傻逼似的坚持