hjd1964 / SmartHandController

Smart Hand Controller for OnStep and OnStepX
GNU General Public License v3.0
13 stars 21 forks source link

Lots of errors from Ephemeris about PROGMEM #2

Closed kbahey closed 3 years ago

kbahey commented 3 years ago

I have the Ephemeris library installed from the Library Manager (not manually from git) and it is the latest available version.

When compiling, I get the following errors, and much much more of the same.

Here is an excerpt:

In file included from ../Arduino/libraries/Ephemeris/Ephemeris.hpp:32,
                 from ../Arduino/libraries/Ephemeris/Ephemeris.h:23,
                 from sketch/src/commands/LX200.cpp:4:
../Arduino/libraries/Ephemeris/VSOP87.hpp:25:21: error: 'PROGMEM' does not name a type
 #define CONST const PROGMEM
                     ^~~~~~~
../Arduino/libraries/Ephemeris/VSOP87.hpp:43:1: note: in expansion of macro 'CONST'
 CONST VSOP87Coefficient L0MercuryCoefficients[]
 ^~~~~
../Arduino/libraries/Ephemeris/VSOP87.hpp:25:21: note: the macro 'PROGMEM' had not yet been defined
 #define CONST const PROGMEM
                     ^~~~~~~
../Arduino/libraries/Ephemeris/VSOP87.hpp:43:1: note: in expansion of macro 'CONST'
 CONST VSOP87Coefficient L0MercuryCoefficients[]
 ^~~~~
kbahey commented 3 years ago

The underlying reason here is that the ESP32 chokes on code in the Ephemeris' VSOP87.hpp and ELP2000.hpp

Specifically this code:

#if ARDUINO
#define CONST const PROGMEM
#else
#define CONST const
#endif

Changing that to just:

#define CONST const

Makes it compile and run successfully on an ESP32 SHC.

Not sure if we should report this to Sebastien, to change the ARDUINO ifdef or what.

Thoughts?

kbahey commented 3 years ago

Found a solution to this, which is in pull request #3.

hjd1964 commented 3 years ago

As mentioned this has already been handled by using my branch of the Ephemeris.

kbahey commented 3 years ago

Well, it works with the official Ephemeris library too. So all is well.

kbahey commented 3 years ago

Actually, no. My fork has the conditional on ESP32, and that is why it works.