#include <stdarg.h>
#include <string.h>
extern void USART1_DMA_send(uint8_t*pBuffer, uint8_tnum);
char test_buffer[512];
int printf(const char *format,...)
{
va_list arg;
va_start(arg, format);
iReturn = vsprintf(test_buffer, format, arg);
va_end(arg);
USART1_DMA_send((uint8_t*)test_buffer, strlen(test_buffer));
return 0;
}
STM32/单片机重构printf实现串口打印功能
最新推荐文章于 2023-11-17 09:41:41 发布