Skip to content

Commit c427186

Browse files
Fix pgm_read_ptr_near/far
This was missing one level of pointer indirection, making any use of these functions fail at compiletime.
1 parent 22a1d46 commit c427186

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: cpp/arduino/avr/pgmspace.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ typedef uintptr_t uint_farptr_t;
4141
#define pgm_read_word_near(address_short) (* (const uint16_t *) (address_short) )
4242
#define pgm_read_dword_near(address_short) (* (const uint32_t *) (address_short) )
4343
#define pgm_read_float_near(address_short) (* (const float *) (address_short) )
44-
#define pgm_read_ptr_near(address_short) (* (const void *) (address_short) )
44+
#define pgm_read_ptr_near(address_short) (* (const void **) (address_short) )
4545

4646
#define pgm_read_byte_far(address_long) (* (const uint8_t *) (address_long) )
4747
#define pgm_read_word_far(address_long) (* (const uint16_t *) (address_long) )
4848
#define pgm_read_dword_far(address_long) (* (const uint32_t *) (address_long) )
4949
#define pgm_read_float_far(address_long) (* (const float *) (address_long) )
50-
#define pgm_read_ptr_far(address_long) (* (const void *) (address_long) )
50+
#define pgm_read_ptr_far(address_long) (* (const void **) (address_long) )
5151

5252
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)
5353
#define pgm_read_word(address_short) pgm_read_word_near(address_short)

0 commit comments

Comments
 (0)