Skip to content

Commit 01adb60

Browse files
committed
feat: add missing PROGMEM variants in ArduinoCore-API
Add the missing _P macro wrappers such as vfprintf_P, printf_P, vsprintf_P, vsnprintf_P, and fprintf_P Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
1 parent 0f4e57e commit 01adb60

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

api/deprecated-avr-comp/avr/pgmspace.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <inttypes.h>
3131

3232
#define PROGMEM
33-
#define __ATTR_PROGMEM__
33+
#define __ATTR_PROGMEM__
3434
#define PGM_P const char *
3535
#define PGM_VOID_P const void *
3636
#define PSTR(str) (str)
@@ -100,6 +100,11 @@ typedef const void* uint_farptr_t;
100100

101101
#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
102102
#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
103+
#define vfprintf_P(fp, s, ...) vfprintf((fp), (s), __VA_ARGS__)
104+
#define printf_P(...) printf(__VA_ARGS__)
105+
#define vsprintf_P(s, ...) vsprintf((s), __VA_ARGS__)
106+
#define vsnprintf_P(s, n, ...) vsnprintf((s), (n), __VA_ARGS__)
107+
#define fprintf_P(fp, ...) fprintf((fp), __VA_ARGS__)
103108

104109
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
105110
#define pgm_read_word(addr) (*(const unsigned short *)(addr))

0 commit comments

Comments
 (0)