Closed chinesefellow closed 3 years ago
Hi @chinesefellow,
Thank you very much for reporting this bug.
The problem came from the fact that Particle defines some of the pgm_read_XXX
macros in spark_wiring_arduino.h, like pgm_read_byte
and pgm_read_word
, but lacks pgm_read_ptr
, pgm_read_float
, and pgm_read_dword
.
Particle does define these macros in avr/pgm_space.h, but I cannot include this header from ArduinoJson because the Arduino Core API deprecated it so it may not be available on every platform.
To fix this issue, I added a check before enabling support for PROGMEM
in ArduinoJson: it now verifies that all macros are defined.
Moreover, I added Particle Argon to the Continuous Integration so this kind of problem never happens again.
Until the fix is published, you can simply define ARDUINOJSON_ENABLE_PROGMEM to 0
.
Best regards, Benoit
Thank you for such a great library! My students and I use it every year.
Daniel Law he / him / his Teacher of Awesome Things FIRST Robotics Competition Coach Computer Science Department Chair Lane Tech High School drlaw@cps.edu
*One who makes no mistakes makes nothing. - *Giacomo Casanova
On Wed, Nov 11, 2020 at 2:57 AM Benoît Blanchon notifications@github.com wrote:
Hi @chinesefellow https://github.com/chinesefellow,
Thank you very much for reporting this bug.
The problem came from the fact that Particle defines some of the pgm_read_XXX macros in spark_wiring_arduino.h https://github.com/particle-iot/device-os/blob/7b7d28bf76db44111271abac23d247f09ebb8540/wiring/inc/spark_wiring_arduino.h, like pgm_read_byte and pgm_read_word, but lacks pgm_read_ptr, pgm_read_float, and pgm_read_dword. Particle does define these macros in avr/pgm_space.h https://github.com/particle-iot/device-os/blob/1b1805fb4afcb93b0e92fbecfd28c082d6310285/wiring/inc/avr/pgmspace.h, but I cannot include this header from ArduinoJson because the Arduino Core API deprecated it https://github.com/arduino/ArduinoCore-API/blob/cd4ba4ca9ebc3421c65d3b19abe60820b8c4cf25/api/deprecated-avr-comp/avr/pgmspace.h so it may not be available on every platform.
To fix this issue, I added a check before enabling support for PROGMEM in ArduinoJson: it now verifies that all macros are defined.
Moreover, I added Particle Argon to the Continuous Integration https://github.com/bblanchon/ArduinoJson/commit/aa7cc5351cd9ea04a1b5dfedf3fc19c5c9a920ed so this kind of problem never happens again.
Until the fix is published, you can simply define ARDUINOJSON_ENABLE_PROGMEM https://arduinojson.org/v6/api/config/enable_progmem/ to 0.
Best regards, Benoit
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bblanchon/ArduinoJson/issues/1433#issuecomment-725294804, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACN2IYBP45NGK3FTGJ54CRDSPJGWNANCNFSM4TP3WDFA .
The fix was published in version 6.17.2.
Tried including the ArduinoJson library today. Version 6.17.1. Without writing any additional code besides having an empty setup and loop function, a compiler error is generated.
I have another project/app in the Particle environment using version 6.14.1 and that one is still working.
Here's the raw error: