*/
INLINE uint16_t updcrc_ccitt(uint8_t c, uint16_t oldcrc)
{
-#if CPU_HARVARD
- return (oldcrc >> 8) ^ pgm_read_uint16_t(&crc_ccitt_tab[(oldcrc ^ c) & 0xff]);
-#else
- return (oldcrc >> 8) ^ crc_ccitt_tab[(oldcrc ^ c) & 0xff];
-#endif
+ return (oldcrc >> 8) ^ pgm_read16(&crc_ccitt_tab[(oldcrc ^ c) & 0xff]);
}
/** CRC-CCITT init value */
* Official array of 256 byte pemutation contructed from digits of pi, defined
* in the RFC 1319.
*/
- static const uint8_t PGM_ATTR md2_perm[256] =
+ static const uint8_t PROGMEM md2_perm[256] =
{
41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
31, 26, 219, 153, 141, 51, 159, 17, 131, 20
};
- #define MD2_PERM(x) PGM_READ_CHAR(&md2_perm[x])
+ #define MD2_PERM(x) pgm_read8(&md2_perm[x])
#else
/**
* Md2_perm() function generate an array of 256 "casual" permutation.
uint16_t new_idx = idx % (SIN_LEN / 2);
new_idx = (new_idx >= (SIN_LEN / 4)) ? (SIN_LEN / 2 - new_idx - 1) : new_idx;
- #if CPU_HARVARD
- uint8_t data = pgm_read_char(&sin_table[new_idx]);
- #else
- uint8_t data = sin_table[new_idx];
- #endif
+ uint8_t data = pgm_read8(&sin_table[new_idx]);
return (idx >= (SIN_LEN / 2)) ? (255 - data) : data;
}