在 /* 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;
- }
|