hjd1964/OnStepX

Errors when trying to compile with GPS

kbahey opened this issue · 7 comments

When I try to compile with GPS (for the S6), I get the following errors

sketch/src/telescope/mount/site/Site.cpp: In function 'void gpsCheck()':
sketch/src/telescope/mount/site/Site.cpp:24:40: error: 'elevation' was not declared in this scope
   24 |       tls.getSite(latitude, longitude, elevation);
      |                                        ^~~~~~~~~
sketch/src/telescope/mount/site/Site.cpp:34:7: error: 'dateIsReady' was not declared in this scope
   34 |       dateIsReady = true;
      |       ^~~~~~~~~~~
sketch/src/telescope/mount/site/Site.cpp:35:7: error: 'timeIsReady' was not declared in this scope
   35 |       timeIsReady = true;
      |       ^~~~~~~~~~~
exit status 1

Simple fix for the elevation part, just declare the variable:

diff --git a/src/telescope/mount/site/Site.cpp b/src/telescope/mount/site/Site.cpp
--- a/src/telescope/mount/site/Site.cpp
+++ b/src/telescope/mount/site/Site.cpp
@@ -21,6 +21,7 @@ IRAM_ATTR void clockTickWrapper() { centisecondLAST++; }
     if (tls.ready) {
       VF("MSG: Tls_GPS, setting site from GPS");
       double latitude, longitude;
+      float elevation;
       tls.getSite(latitude, longitude, elevation);
       site.location.latitude = degToRad(latitude);
       site.location.longitude = degToRad(longitude);

The other two errors are more involved, since gpsCheck is not a class member method. Trying to make it so causes other errors when it is called in tasks.add()

I fixed these

Thanks.

Now a different error:

sketch/src/telescope/mount/Mount.h:176:5: error: 'Axis' does not name a type
  176 |     Axis axis1;
      |     ^~~~
sketch/src/telescope/mount/Mount.h:177:5: error: 'Axis' does not name a type
  177 |     Axis axis2;

I think having all the defaults in one place, and all of them with ifndef, will make it easier to see what gets set if not set in Config.h.

On the other hand, since this is not supposed to be a user visible (nor editable) file, then it is fair game for the developer to modularize them.

I am more concerned that Config.h remains the only place where users can edit parameters, and you seem to agree with this. Let us not shock the users with drastic changes (to user editable parts).