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:
parent
6afddf5680
commit
1189d809a6
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue