来源
写stc单片机的时候发现串口用的不方便,就用32的代码,改了一个重定向过来。
代码如下
#include "stdarg.h"
#include "stdio.h"
#include "USART.h"
#define CONSOLEBUF_SIZE 64
void PrintfDebug(const char *fmt, ...)
{
u8 xdata Uart_buf[CONSOLEBUF_SIZE];
va_list args;
va_start(args, fmt);
vsprintf(Uart_buf, fmt, args);
va_end(args);
PrintString1(Uart_buf);
}
本文介绍了如何在STC单片机开发中遇到不便时,通过修改32位代码实现串口输出重定向,提供了一个实用的printfDebug函数,便于调试和日志记录。
&spm=1001.2101.3001.5002&articleId=124744422&d=1&t=3&u=35dc5f27af534a8695cc38258638e657)
3874

被折叠的 条评论
为什么被折叠?



