Skip to content

Commit e962c3e

Browse files
Merge pull request #95 from OpenAstroTech/fix-gps-headless
V1.8.38 - Updates
2 parents 4ed2d4f + 15935fc commit e962c3e

File tree

7 files changed

+28
-25
lines changed

7 files changed

+28
-25
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define VERSION "V1.8.37"
1+
#define VERSION "V1.8.38"

Software/Arduino code/OpenAstroTracker/src/MeadeCommandProcessor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "Gyro.hpp"
77

88
#if USE_GPS == 1
9-
bool gpsAqcuisitionComplete(); // defined in c72_menuHA_GPS.hpp
9+
bool gpsAqcuisitionComplete(int & indicator); // defined in c72_menuHA_GPS.hpp
1010
#endif
1111
/////////////////////////////////////////////////////////////////////////////////////////
1212
//
@@ -537,8 +537,9 @@ String MeadeCommandProcessor::handleMeadeGPSCommands(String inCmd) {
537537
}
538538
// Wait at most 2 minutes
539539
unsigned long timeoutTime = millis() + timeoutLen;
540+
int indicator = 0;
540541
while (millis() < timeoutTime) {
541-
if (gpsAqcuisitionComplete()) {
542+
if (gpsAqcuisitionComplete(indicator)) {
542543
LOGV1(DEBUG_MEADE, F("MEADE: GPS startup, GPS acquired"));
543544
return "1";
544545
}

Software/Arduino code/OpenAstroTracker/src/Mount.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "Mount.hpp"
55
#include "Utility.hpp"
66
#include "EPROMStore.hpp"
7-
#include "Sidereal.hpp"
87
#include "../Configuration_adv.hpp"
98
#include "../Configuration_pins.hpp"
109
#include "inc/Globals.hpp"
@@ -652,7 +651,7 @@ void Mount::setSpeedCalibration(float val, bool saveToStorage) {
652651
// The tracker simply needs to rotate at 15degrees/hour, adjusted for sidereal
653652
// time (i.e. the 15degrees is per 23h56m04s. 86164s/86400 = 0.99726852. 3590/3600 is the same ratio) So we only go 15 x 0.99726852 in an hour.
654653
#if RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART
655-
_trackingSpeed = _trackingSpeedCalibration * ((_stepsPerRADegree / SET_MICROSTEPPING) * TRACKING_MICROSTEPPING) * siderealDegreesInHour / 3600.0f;
654+
_trackingSpeed = _trackingSpeedCalibration * _stepsPerRADegree * TRACKING_MICROSTEPPING * siderealDegreesInHour / (3600.0f * SET_MICROSTEPPING);
656655
#else
657656
_trackingSpeed = _trackingSpeedCalibration * _stepsPerRADegree * siderealDegreesInHour / 3600.0f;
658657
#endif
@@ -1123,10 +1122,9 @@ void Mount::guidePulse(byte direction, int duration) {
11231122
#if RA_STEPPER_TYPE == STEPPER_TYPE_28BYJ48
11241123
float raTrackingSpeed = _stepsPerRADegree * siderealDegreesInHour / 3600.0f;
11251124
#else
1126-
float raTrackingSpeed = ((_stepsPerRADegree / SET_MICROSTEPPING) * TRACKING_MICROSTEPPING) * siderealDegreesInHour / 3600.0f;
1125+
float raTrackingSpeed = 1.0 * _stepsPerRADegree * TRACKING_MICROSTEPPING * siderealDegreesInHour / (3600.0f * SET_MICROSTEPPING);
11271126
#endif
11281127

1129-
11301128
// TODO: Do we need to track how many steps the steppers took and add them to the GoHome calculation?
11311129
// If so, we need to remember where we were when we started the guide pulse. Then at the end,
11321130
// we can calculate the difference.

Software/Arduino code/OpenAstroTracker/src/c65_startup.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#pragma once
22
#include "../Configuration_adv.hpp"
33

4+
#if USE_GPS == 1
5+
#include "Sidereal.hpp"
6+
#endif
7+
48
#if HEADLESS_CLIENT == 0
59
#if SUPPORT_GUIDED_STARTUP == 1
610

7-
#include "Sidereal.hpp"
8-
911
//////////////////////////////////////////////////////////////
1012
// This file contains the Starup 'wizard' that guides you through initial setup
1113

Software/Arduino code/OpenAstroTracker/src/c72_menuHA_GPS.hpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,9 @@
44
#include "../Configuration_adv.hpp"
55
#include "../Configuration_pins.hpp"
66

7-
#if HEADLESS_CLIENT == 0
87
#if USE_GPS == 1
98

10-
// States that HA menu displays goes through
11-
#define SHOWING_HA_SYNC 1
12-
#define SHOWING_HA_SET 2
13-
#define ENTER_HA_MANUALLY 3
14-
#define STARTING_GPS 4
15-
#define SIGNAL_AQCUIRED 5
16-
17-
int indicator = 0;
18-
int haState = STARTING_GPS;
19-
20-
bool gpsAqcuisitionComplete()
9+
bool gpsAqcuisitionComplete(int & indicator)
2110
{
2211
while (GPS_SERIAL_PORT.available())
2312
{
@@ -55,14 +44,26 @@ bool gpsAqcuisitionComplete()
5544
return false;
5645
}
5746

47+
#if HEADLESS_CLIENT == 0
48+
49+
// States that HA menu displays goes through
50+
#define SHOWING_HA_SYNC 1
51+
#define SHOWING_HA_SET 2
52+
#define ENTER_HA_MANUALLY 3
53+
#define STARTING_GPS 4
54+
#define SIGNAL_AQCUIRED 5
55+
56+
int indicator = 0;
57+
int haState = STARTING_GPS;
58+
5859
bool processHAKeys()
5960
{
6061
byte key;
6162
bool waitForRelease = false;
6263

6364
if (haState == STARTING_GPS)
6465
{
65-
if (gpsAqcuisitionComplete())
66+
if (gpsAqcuisitionComplete(indicator))
6667
{
6768
LOGV1(DEBUG_INFO, F("HA: GPS acquired"));
6869
GPS_SERIAL_PORT.end();
@@ -193,5 +194,6 @@ void printHASubmenu()
193194
}
194195
lcdMenu.printMenu(satBuffer);
195196
}
197+
196198
#endif
197199
#endif

Software/Arduino code/OpenAstroTracker/src/c76_menuCAL.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ bool processCalibrationKeys()
486486
{
487487
calState = ROLL_OFFSET_CONFIRM;
488488
lcdMenu.setCursor(0, 0);
489-
lcdMenu.printMenu("Set level?");
489+
lcdMenu.printMenu(F("Set as level?"));
490490
}
491491
else if (key == btnLEFT)
492492
{
@@ -526,7 +526,7 @@ bool processCalibrationKeys()
526526
{
527527
calState = PITCH_OFFSET_CONFIRM;
528528
lcdMenu.setCursor(0, 0);
529-
lcdMenu.printMenu("Set level?");
529+
lcdMenu.printMenu(F("Set as level?"));
530530
}
531531
else if (key == btnLEFT)
532532
{

Software/Arduino code/OpenAstroTracker/src/c78_menuINFO.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void printStatusSubmenu() {
7474

7575
case 2: {
7676
if (subIndex == 0) {
77-
lcdMenu.printMenu("TRK Stepr:" + String(mount.getCurrentStepperPosition(TRACKING)));
77+
lcdMenu.printMenu("TRK Stpr:" + String(mount.getCurrentStepperPosition(TRACKING)));
7878
}
7979
else {
8080
sprintf(scratchBuffer, "TRK Spd:");

0 commit comments

Comments
 (0)