[En-Nut-Discussion] Reading Program Memory Arrays

Harald Kipp harald.kipp at egnite.de
Wed Oct 2 12:28:04 CEST 2002


Sorry, Peter. The answer comes a bit late.

There are different solutions:

u_short val;

/* Solution 1 */
memcpy_P(&val, &ccitt_16_table[i], sizeof(u_short));

/* Solution 2 */
val = PRG_RDB(&ccitt_16_table[i]) + PRG_RDB(((u_char *)&ccitt_16_table[i]) 
+ 1) << 8;

In any case you need to transfer the progmem u_short to
a SRAM u_short first.

Harald




More information about the En-Nut-Discussion mailing list