-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pgm_read_ptr()
: 'const void*' is not a pointer-to-object type
#864
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,7 @@ extern HardwareSPI SPI; | |
#include <pgmspace.h> | ||
#define PRIPSTR "%s" | ||
#ifndef pgm_read_ptr | ||
#define pgm_read_ptr(p) (*(p)) | ||
#define pgm_read_ptr(p) (*(void* const*)(p)) | ||
#endif | ||
#elif defined(ARDUINO) && !defined(ESP_PLATFORM) && !defined(__arm__) && !defined(__ARDUINO_X86__) || defined(XMEGA) | ||
#include <avr/pgmspace.h> | ||
|
@@ -208,7 +208,7 @@ typedef uint16_t prog_uint16_t; | |
#define pgm_read_word(p) (*(p)) | ||
#endif | ||
#if !defined pgm_read_ptr || defined ARDUINO_ARCH_MBED | ||
#define pgm_read_ptr(p) (*(p)) | ||
#define pgm_read_ptr(p) (*(void* const*)(p)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is need to satisfy the changes in arduino/ArduinoCore-API#118 I suspect that this is the problem shown in bblanchon/ArduinoJson#1790, but the line/column numbers don't match. Ultimately, this should affect any board wrapping the mbed framework (which is most of the newer boards that Arduino has produced). |
||
#endif | ||
#ifndef PRIPSTR | ||
#define PRIPSTR "%s" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is not used. Maybe at some point in the past it was needed, but the latest versions of the ESP* cores have their own definitions
arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\sys\
However, the definition doesn't match the definition in ArduinoCore-API without explicitly defining
Arduino15\packages\esp32\hardware\esp32\2.0.4\cores\esp32\
which matches the ArduinoCore-API definition.