Raspberry Pi Pico RP2040 fail to compile
Created by: cotestatnt
Describe the bug
Raspberry Pi Pico RP2040 fail to compile due to error in pgmspace.hpp
Troubleshooter report
Here is the report generated by the ArduinoJson Troubleshooter:
ArduinoJson Troubleshooter's report
- The issue happens at compile time
- The error is not in the list
Environment
Here is the environment that I used:
- Raspberry Pi Pico RP2040
- Arduino Mbed OS RP2040 and Raspberry Pi Pico/RP2040
- Arduino IDE 1.8.16
Reproduction
Tested with StringExample.ino and with others example
Compiler output
...src/ArduinoJson/Polyfills/pgmspace.hpp: In function 'uint32_t pgm_read_dword(ArduinoJson6190_F1::pgm_p)':
...src/ArduinoJson/Polyfills/pgmspace.hpp:102:3: error: cannot convert 'ArduinoJson6190_F1::pgm_p' to 'const void*'
102 | memcpy_P(&result, p, 4);
Forcing the undef of memcpy_P before including ArduinoJson.h I can compile and it works as expected, but if I do the same in one of my library which has ArduinoJson as dependency it doesn't work. I have to edit directly the pgmspace.hpp
(I suppose due to the Arduino compiler).
#undef memcpy_P
#include <ArduinoJson.h>
.....