From 72f7d07b915bc6a874ec820de585c6d017c81a94 Mon Sep 17 00:00:00 2001 From: bernie Date: Tue, 19 Jul 2005 07:24:57 +0000 Subject: [PATCH] PGM_STR(): New macro. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@423 38d2e660-2303-0410-9eaa-f027e97ec537 --- mware/pgm.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mware/pgm.h b/mware/pgm.h index 87b46b28..ea28043e 100755 --- a/mware/pgm.h +++ b/mware/pgm.h @@ -23,6 +23,7 @@ #define MWARE_PGM_H #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 /* \} */ -- 2.25.1