X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fpgm.h;h=ea28043e98587cdf166bffec5c81844cecff752c;hb=02119aca75e842d92288d5a0ce02558b42267c7f;hp=20bb416e3aab2e202629bf562b3681a8d0db7549;hpb=cdf3e45aaa38fc701dceeb57e6ceedd6ca68f408;p=bertos.git diff --git a/mware/pgm.h b/mware/pgm.h index 20bb416e..ea28043e 100755 --- a/mware/pgm.h +++ b/mware/pgm.h @@ -22,7 +22,8 @@ #ifndef MWARE_PGM_H #define MWARE_PGM_H -#include +#include +#include /* For intXX_t */ #if CPU_AVR @@ -135,8 +136,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 +202,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 /* \} */