General Options->Library Configuration的Library要选择Full
不要忘了加上stdio.h头文件
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
/**
* @brief
* @note
* @param
* @retval
*/
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */
USART_SendData(USART1, (u8) ch);
/* Loop until the end of transmission */
while(USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)
{
}
return ch;
}
文章评论(0条评论)
登录后参与讨论