pgm_read_int(): New macro.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 20 Mar 2006 17:51:08 +0000 (17:51 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 20 Mar 2006 17:51:08 +0000 (17:51 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@572 38d2e660-2303-0410-9eaa-f027e97ec537

mware/pgm.h

index cb81e54813634c9d8af8da6f5e363e0e68260be1..673b143dca7fca89db86ac27833b7cd4c448897d 100755 (executable)
@@ -76,7 +76,8 @@
                })
 
 
-       #else
+       #else /* !__AVR_ENHANCED__ */
+
                #define pgm_read_char(addr) \
                ({ \
                        uint16_t __addr16 = (uint16_t)(addr); \
                        __result; \
                })
 
+       #endif /* !__AVR_ENHANCED__ */
+
+       #if SIZEOF_INT == 2
+               #define pgm_read_int(addr) ((int)pgm_read_uint16_t(addr))
+       #else
+               #error Missing support for CPU word size != 16bit
        #endif
 
        #ifndef PROGMEM
 #endif
 
 #ifndef PROGMEM
-#define PROGMEM                /* nothing */
+#define PROGMEM         /* nothing */
 #endif
 
 /*!