我正在将基于 T6963 的 LCD 驱动程序从 AVR-GCC 移植到微芯片 C18 编译器。我看过宏“ pgm_read_byte ”:有人知道如何移植这个宏吗?
更新
从这里我可以看到宏的实现
#define pgm_read_byte(address_short)
pgm_read_byte_near(address_short)
...
#define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))
...
#define __LPM(addr) __LPM_enhanced__(addr)
...
#define __LPM_enhanced__(addr) \
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint8_t __result; \
__asm__ \
( \
"lpm %0, Z" "\n\t" \
: "=r" (__result) \
: "z" (__addr16) \
); \
__result; \
}))