projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TRACEMSG() support for compilers with no variadic macros.
[bertos.git]
/
mware
/
pgm.h
diff --git
a/mware/pgm.h
b/mware/pgm.h
index d8ef9f5426df09b5996b9c0c0ce64a7cf70d762c..cb81e54813634c9d8af8da6f5e363e0e68260be1 100755
(executable)
--- a/
mware/pgm.h
+++ b/
mware/pgm.h
@@
-22,7
+22,9
@@
#ifndef MWARE_PGM_H
#define MWARE_PGM_H
#ifndef MWARE_PGM_H
#define MWARE_PGM_H
-#include <cpu_detect.h>
+#include <cfg/cpu_detect.h>
+#include <cfg/compiler.h> /* For intXX_t */
+#include <cfg/cpu.h> /* For CPU_HARVARD */
#if CPU_AVR
#if CPU_AVR
@@
-135,8
+137,12
@@
#endif
#endif
+ #ifndef PROGMEM
#define PROGMEM __attribute__((__progmem__))
#define PROGMEM __attribute__((__progmem__))
+ #endif
+ #ifndef PSTR
#define PSTR(s) ({ static const char __c[] PROGMEM = (s); &__c[0]; })
#define PSTR(s) ({ static const char __c[] PROGMEM = (s); &__c[0]; })
+ #endif
#elif CPU_HARVARD
#error Missing CPU support
#elif CPU_HARVARD
#error Missing CPU support
@@
-164,9
+170,7
@@
typedef PROGMEM uint32_t pgm_uint32_t;
/*\}*/
/*!
/*\}*/
/*!
- * \def PGM_READ_CHAR
- * \def PGM_FUNC
- * \def PGM_ATTR
+ * \name PGM support macros.
*
* These macros enable dual compilation of code for both program
* and data memory.
*
* These macros enable dual compilation of code for both program
* and data memory.
@@
-193,16
+197,21
@@
typedef PROGMEM uint32_t pgm_uint32_t;
* // To be used when invoking inside other PGM_FUNC functions:
* PGM_FUNC(lcd_puts)(some_string);
* \endcode
* // To be used when invoking inside other PGM_FUNC functions:
* PGM_FUNC(lcd_puts)(some_string);
* \endcode
+ *
+ * \{
*/
#ifdef _PROGMEM
#define PGM_READ_CHAR(s) pgm_read_char(s)
#define PGM_FUNC(x) x ## _P
*/
#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_ATTR PROGMEM
#else
#define PGM_READ_CHAR(s) (*(s))
#define PGM_FUNC(x) x
+ #define PGM_STR(x) x
#define PGM_ATTR /* nothing */
#endif
#define PGM_ATTR /* nothing */
#endif
+/* \} */
#endif /* MWARE_PGM_H */
#endif /* MWARE_PGM_H */