diff --git a/libraries/FastSerial/examples/FastSerial/FastSerial.pde b/libraries/FastSerial/examples/FastSerial/FastSerial.pde index 6e4421ee4b..4a9ae94b51 100644 --- a/libraries/FastSerial/examples/FastSerial/FastSerial.pde +++ b/libraries/FastSerial/examples/FastSerial/FastSerial.pde @@ -14,6 +14,12 @@ // #include +#undef PROGMEM +#define PROGMEM __attribute__(( section(".progmem.data") )) + +#undef PSTR +#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) + // // Create a FastSerial driver that looks just like the stock Arduino // driver. diff --git a/libraries/FastSerial/vprintf.cpp b/libraries/FastSerial/vprintf.cpp index e52f972bfe..96d1efe030 100644 --- a/libraries/FastSerial/vprintf.cpp +++ b/libraries/FastSerial/vprintf.cpp @@ -48,6 +48,12 @@ extern "C" { #include "xtoa_fast.h" } +// workaround for GCC bug c++/34734 +#undef PROGMEM +#define PROGMEM __attribute__(( section(".progmem.data") )) +#undef PSTR +#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) + #define GETBYTE(flag, mask, pnt) ({ \ unsigned char __c; \ asm ( \