Browse Source

Improve printf_P() compatibility on Teensy 3.x

teensy4-core
PaulStoffregen 9 years ago
parent
commit
eb3e46ac85
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      teensy3/avr/pgmspace.h

+ 5
- 5
teensy3/avr/pgmspace.h View File

#define strstr_P(a, b) strstr((a), (b)) #define strstr_P(a, b) strstr((a), (b))
#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__) #define sprintf_P(s, ...) sprintf((s), __VA_ARGS__)
#define vfprintf_P(fp, s, ...) vfprintf((fp), (s), __VA_ARGS__) #define vfprintf_P(fp, s, ...) vfprintf((fp), (s), __VA_ARGS__)
#define printf_P(f, ...) printf((f), __VA_ARGS__)
#define snprintf_P(s, n, f, ...) snprintf((s), (n), (f), __VA_ARGS__)
#define vsprintf_P(s, f, ...) vsprintf((s), (f), __VA_ARGS__)
#define vsnprintf_P(s, n, f, ...) vsnprintf((s), (n), (f), __VA_ARGS__)
#define fprintf_P(fp, f, ...) fprintf((fp), (f), __VA_ARGS__)
#define printf_P(...) printf(__VA_ARGS__)
#define snprintf_P(s, n, ...) snprintf((s), (n), __VA_ARGS__)
#define vsprintf_P(s, ...) vsprintf((s), __VA_ARGS__)
#define vsnprintf_P(s, n, ...) vsnprintf((s), (n), __VA_ARGS__)
#define fprintf_P(fp, ...) fprintf((fp), __VA_ARGS__)


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

Loading…
Cancel
Save