Simulator: add pgm_read_dword() macro.

pgm_read_word() was already defined, but pgm_read_dword() did not
get in our way during earlier testing. These functions force the
arduino to read these "defined in program" constant arrays from
"program memory" instead of RAM as a means to save on RAM usage.
The PC-based simulator doesn't need such tricks and only needs to
read the value directly from the in-RAM array. Therefore it is safe
to convert read directly from the pointer being passed.

pgm_read_word() already does this. Define pgm_read_dword()
similarly to it. Fixes #125.
This commit is contained in:
Phil Hord 2015-04-13 18:38:51 -04:00 committed by Markus Hitter
parent 6afddf5680
commit 1189d809a6
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@
#define PSTR(x) (x)
#define pgm_read_byte(x) (*((uint8_t *)(x)))
#define pgm_read_word(x) (*((uint16_t *)(x)))
#define pgm_read_dword(x) (*((uint32_t *)(x)))
#define MASK(PIN) (1 << PIN)
#define ACD 7