diff --git a/libraries/FastSerial/BetterStream.cpp b/libraries/FastSerial/BetterStream.cpp index e8cb7b97be..47519b9295 100644 --- a/libraries/FastSerial/BetterStream.cpp +++ b/libraries/FastSerial/BetterStream.cpp @@ -44,15 +44,21 @@ BetterStream::printf(const char *fmt, ...) } void -BetterStream::_printf_P(const prog_char *fmt, ...) +BetterStream::_printf_P(const prog_char_t *fmt, ...) { va_list ap; va_start(ap, fmt); - _vprintf(1, fmt, ap); + _vprintf(1, (const char *)fmt, ap); va_end(ap); } +void +BetterStream::vprintf_P(const prog_char_t *fmt, va_list ap) +{ + _vprintf(1, (const char *)fmt, ap); +} + int BetterStream::txspace(void) { diff --git a/libraries/FastSerial/BetterStream.h b/libraries/FastSerial/BetterStream.h index 791075ad4d..f21c3d8185 100644 --- a/libraries/FastSerial/BetterStream.h +++ b/libraries/FastSerial/BetterStream.h @@ -25,12 +25,13 @@ public: void println_P(const prog_char_t *); void printf(const char *, ...) __attribute__ ((format(__printf__, 2, 3))); - void _printf_P(const prog_char *, ...); + void _printf_P(const prog_char_t *, ...); __attribute__ ((format(__printf__, 2, 3))); + void vprintf_P(const prog_char_t *, va_list); virtual int txspace(void); -#define printf_P(fmt, ...) _printf_P((const prog_char *)fmt, ## __VA_ARGS__) +#define printf_P(fmt, ...) _printf_P((const prog_char_t *)fmt, ## __VA_ARGS__) private: void _vprintf(unsigned char, const char *, va_list)