Skip to content

Commit 77ac6be

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 b542e6a commit 77ac6be

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
@@ -33,13 +33,13 @@ out.each { |l| puts d(l) }
3333
#define pgm_read_word_near(address_short) (* (const uint16_t *) (address_short) )
3434
#define pgm_read_dword_near(address_short) (* (const uint32_t *) (address_short) )
3535
#define pgm_read_float_near(address_short) (* (const float *) (address_short) )
36-
#define pgm_read_ptr_near(address_short) (* (const void *) (address_short) )
36+
#define pgm_read_ptr_near(address_short) (* (const void **) (address_short) )
3737

3838
#define pgm_read_byte_far(address_long) (* (const uint8_t *) (address_long) )
3939
#define pgm_read_word_far(address_long) (* (const uint16_t *) (address_long) )
4040
#define pgm_read_dword_far(address_long) (* (const uint32_t *) (address_long) )
4141
#define pgm_read_float_far(address_long) (* (const float *) (address_long) )
42-
#define pgm_read_ptr_far(address_long) (* (const void *) (address_long) )
42+
#define pgm_read_ptr_far(address_long) (* (const void **) (address_long) )
4343

4444
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)
4545
#define pgm_read_word(address_short) pgm_read_word_near(address_short)

0 commit comments

Comments
 (0)