X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fpgm.h;h=cb81e54813634c9d8af8da6f5e363e0e68260be1;hb=ef9091677fa3d4fb9f903fcb5debe52d5b52a8cf;hp=87b46b2822c49ba598766fb9163cef380d5e9b65;hpb=af9c555446161016fdd76c1cdff96ce76bb6cba2;p=bertos.git diff --git a/mware/pgm.h b/mware/pgm.h index 87b46b28..cb81e548 100755 --- a/mware/pgm.h +++ b/mware/pgm.h @@ -23,6 +23,8 @@ #define MWARE_PGM_H #include +#include /* For intXX_t */ +#include /* For CPU_HARVARD */ #if CPU_AVR @@ -135,8 +137,12 @@ #endif + #ifndef PROGMEM #define PROGMEM __attribute__((__progmem__)) + #endif + #ifndef PSTR #define PSTR(s) ({ static const char __c[] PROGMEM = (s); &__c[0]; }) + #endif #elif CPU_HARVARD #error Missing CPU support @@ -197,10 +203,12 @@ typedef PROGMEM uint32_t pgm_uint32_t; #ifdef _PROGMEM #define PGM_READ_CHAR(s) pgm_read_char(s) #define PGM_FUNC(x) x ## _P + #define PGM_STR(x) PSTR(x) #define PGM_ATTR PROGMEM #else #define PGM_READ_CHAR(s) (*(s)) #define PGM_FUNC(x) x + #define PGM_STR(x) x #define PGM_ATTR /* nothing */ #endif /* \} */