-
Notifications
You must be signed in to change notification settings - Fork 72
meade offset removed conditionally #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,3 +569,9 @@ | |
#error "Debugging not supported on this platform" | ||
#endif | ||
#endif | ||
|
||
// define INDI_SUPPORT in the local configuration if you want it to work | ||
// currently this will fix Meade longitude parsing | ||
#ifndef INDI_SUPPORT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this to the |
||
#define INDI_SUPPORT 0 | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,12 @@ | |
#include "Utility.hpp" | ||
#include "Longitude.hpp" | ||
|
||
#if INDI_SUPPORT == 1 | ||
#define LONGITUDE_OFFSET 0L | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add in #pragma message("Note: INDI offset used, firmware will not function correctly with ASCOM!") ? Just so that we can have traceability if a user is having problems. |
||
#else | ||
#define LONGITUDE_OFFSET 180L | ||
#endif | ||
|
||
////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// -180..180 range, 0 is at the prime meridian (through Greenwich), negative going west, positive going east | ||
|
@@ -41,7 +47,7 @@ Longitude Longitude::ParseFromMeade(String const &s) | |
DayTime dt = DayTime::ParseFromMeade(s); | ||
|
||
//from indilib driver: Meade defines longitude as 0 to 360 WESTWARD (https://github.com/indilib/indi/blob/1b2f462b9c9b0f75629b635d77dc626b9d4b74a3/drivers/telescope/lx200driver.cpp#L1019) | ||
result.totalSeconds = 180L * 3600L - dt.getTotalSeconds(); | ||
result.totalSeconds = LONGITUDE_OFFSET * 3600L - dt.getTotalSeconds(); | ||
result.checkHours(); | ||
|
||
LOGV4(DEBUG_GENERAL, F("[LONGITUDE]: Parse(%s) -> %s = %ls"), s.c_str(), result.ToString(), result.getTotalSeconds()); | ||
|
@@ -72,7 +78,7 @@ const char *Longitude::formatString(char *targetBuffer, const char *format, long | |
long secs = totalSeconds; | ||
|
||
// Map to 0..360 westwards | ||
secs = 180L * 3600L - secs; | ||
secs = LONGITUDE_OFFSET * 3600L - secs; | ||
|
||
long degs = secs / 3600; | ||
secs = secs - degs * 3600; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you need to fetch and rebase your changes onto develop, you created your branch quite a while ago: