在 /* USER CODE BEGIN 1 / 和 / USER CODE END 1 */ 之间加入以下代码:
/**
* [url=home.php?mod=space&uid=247401]@brief[/url] Retargets the C library printf function to the USART.
* @param None
* @retval None
*/
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
|
———————————————— 版权声明:本文为CSDN博主「Fu-yu」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/weixin_53573350/article/details/130928956