//重定义函数1PUTCHAR_PROTOTYPE{/* Place your implementation of fputc here *//* e.g. write a character to the USART */USART_SendData(USART1, (uint8_t) ch);/* 循环等待直到发送结束*/while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET){}return ch;}
//重定义函数2int fputc(int ch, FILE *f){USART_SendData(USART1, (uint8_t) ch);while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET) {}return ch;}
如果觉得《STM32中使用标准库重定义printf()函数》对你有帮助,请点赞、收藏,并留下你的观点哦!