From: bernie Date: Mon, 20 Mar 2006 17:51:08 +0000 (+0000) Subject: pgm_read_int(): New macro. X-Git-Tag: 1.0.0~669 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=eaef2bd654dd52b78d7147a9066ab3d49640ac13;p=bertos.git pgm_read_int(): New macro. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@572 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/mware/pgm.h b/mware/pgm.h index cb81e548..673b143d 100755 --- a/mware/pgm.h +++ b/mware/pgm.h @@ -76,7 +76,8 @@ }) - #else + #else /* !__AVR_ENHANCED__ */ + #define pgm_read_char(addr) \ ({ \ uint16_t __addr16 = (uint16_t)(addr); \ @@ -135,6 +136,12 @@ __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 @@ -153,7 +160,7 @@ #endif #ifndef PROGMEM -#define PROGMEM /* nothing */ +#define PROGMEM /* nothing */ #endif /*!