diff --git a/arduino/libretuya/port/printf/printf_config.h b/arduino/libretuya/port/printf/printf_config.h index 9241bb0..56f6c0d 100644 --- a/arduino/libretuya/port/printf/printf_config.h +++ b/arduino/libretuya/port/printf/printf_config.h @@ -67,3 +67,20 @@ va_end(va); \ return ret; \ } + +#define WRAP_VPRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, va_list arg) { \ + WRAP_DISABLE_CHECK(name); \ + return vprintf(format, arg); \ + } + +#define WRAP_VSPRINTF(name) \ + int __wrap_##name(char *s, const char *format, va_list arg) { \ + return vsprintf(s, format, arg); \ + } + +#define WRAP_VSNPRINTF(name) \ + int __wrap_##name(char *s, size_t count, const char *format, va_list arg) { \ + return vsnprintf(s, count, format, arg); \ + } diff --git a/arduino/realtek-ambz/port/printf/printf.c b/arduino/realtek-ambz/port/printf/printf.c index de49f5d..299feac 100644 --- a/arduino/realtek-ambz/port/printf/printf.c +++ b/arduino/realtek-ambz/port/printf/printf.c @@ -14,4 +14,15 @@ void putchar_(char c) { } WRAP_PRINTF(rtl_printf); +WRAP_SPRINTF(rtl_sprintf); +WRAP_SNPRINTF(rtl_snprintf); +WRAP_VSNPRINTF(rtl_vsnprintf); +WRAP_VSNPRINTF(rtl_vsnprintf_r); +WRAP_VPRINTF(rtl_vprintf); WRAP_PRINTF(DiagPrintf); +WRAP_SPRINTF(DiagSPrintf); +WRAP_SNPRINTF(DiagSnPrintf); +WRAP_PRINTF(prvDiagPrintf); +WRAP_SPRINTF(prvDiagSPrintf); +WRAP_VSPRINTF(VSprintf); +WRAP_PRINTF(LOG_PRINTF); diff --git a/arduino/realtek-ambz/port/printf/printf_port.h b/arduino/realtek-ambz/port/printf/printf_port.h index 3572df8..f54885d 100644 --- a/arduino/realtek-ambz/port/printf/printf_port.h +++ b/arduino/realtek-ambz/port/printf/printf_port.h @@ -6,3 +6,5 @@ WRAP_DISABLE_DEF(rtl_printf); WRAP_DISABLE_DEF(DiagPrintf); +WRAP_DISABLE_DEF(prvDiagPrintf); +WRAP_DISABLE_DEF(LOG_PRINTF);