Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions src/Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,10 @@ void Mount::guidePulse(byte direction, int duration)
const char *directionName = "-NE-S---W";
#endif
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: > Guide Pulse %c for %dms requested", directionName[direction], duration);
if (!isSlewingTRK())
// Deliberately not using isSlewingTRK() here: slewStatus() reports NOT_SLEWING while any guide pulse
// is running, so that check would silently drop every pulse arriving during an active one (e.g. from
// clients that send pulses back-to-back without waiting for completion, like INDI/EKOS).
if (!isTracking())
{
LOG(DEBUG_STEPPERS | DEBUG_GUIDE, "[GUIDE]: guidePulse: Not tracking (at limit?), ignoring guide pulse");
}
Expand Down Expand Up @@ -2532,6 +2535,18 @@ bool Mount::isSlewingTRK() const
return (slewStatus() & SLEWING_TRACKING) != 0;
}

/////////////////////////////////
//
// isTracking
//
/////////////////////////////////
bool Mount::isTracking() const
{
// Unlike isSlewingTRK(), this stays true while a guide pulse is running,
// since slewStatus() reports NOT_SLEWING for the whole guiding block.
return (_mountStatus & STATUS_TRACKING) != 0;
}

/////////////////////////////////
//
// isParking
Expand Down Expand Up @@ -3173,12 +3188,10 @@ void Mount::loop()
LOG(DEBUG_GUIDE, "[MOUNT]: Loop: StopGuiding. Now: %l, RA End: %l, DEC End: %l", now, _guideRaEndTime, _guideDecEndTime);
stopGuiding(stopRaGuiding, stopDecGuiding);
}
else
{
#if INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE
updateInfoDisplay();
#endif
}
// Do not update the info display while a pulse is running: a full-frame render blocks
// loop() for roughly 100ms (1KB over the default 100kHz I2C), which delays the end-time
// checks above and makes guide pulses overshoot their requested duration. The display
// is still refreshed at each pulse start (guidePulse) and between pulses (end of loop()).
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/Mount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class Mount
bool isSlewingRAorDEC() const;
bool isSlewingIdle() const;
bool isSlewingTRK() const;
bool isTracking() const;
bool isParking() const;
bool isGuiding() const;
bool isFindingHome() const;
Expand Down
Loading