From eaef2bd654dd52b78d7147a9066ab3d49640ac13 Mon Sep 17 00:00:00 2001 From: bernie Date: Mon, 20 Mar 2006 17:51:08 +0000 Subject: [PATCH] pgm_read_int(): New macro. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@572 38d2e660-2303-0410-9eaa-f027e97ec537 --- mware/pgm.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 /*! -- 2.25.1