Skip to content

Commit

Permalink
Merge branch 'master' into feature/migrate-ccd
Browse files Browse the repository at this point in the history
  • Loading branch information
naheedsa committed Sep 10, 2024
2 parents 70bf1db + 7c65e20 commit 246abcd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
33 changes: 12 additions & 21 deletions drivers/telescope/lx200ap_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ enum APPECRecordingState
};

// maximum guide pulse request to send to controller
#define MAX_LX200AP_PULSE_LEN 999
#define MAX_LX200AP_PULSE_LEN 999u

// The workaround for long pulses doesn't work!
// #define DONT_SIMULATE_LONG_PULSES true
Expand Down Expand Up @@ -1267,11 +1267,8 @@ IPState LX200AstroPhysicsV2::GuideNorth(uint32_t ms)
GuideNSTID = 0;
}

if (ms > MAX_LX200AP_PULSE_LEN)
{
LOGF_DEBUG("GuideNorth truncating %dms pulse to %dms", ms, MAX_LX200AP_PULSE_LEN);
ms = MAX_LX200AP_PULSE_LEN;
}
ms = std::clamp(ms, 1u, MAX_LX200AP_PULSE_LEN);

if (usePulseCommand)
{
APSendPulseCmd(PortFD, LX200_NORTH, ms);
Expand Down Expand Up @@ -1299,11 +1296,9 @@ IPState LX200AstroPhysicsV2::GuideSouth(uint32_t ms)
GuideNSTID = 0;
}

if (ms > MAX_LX200AP_PULSE_LEN)
{
LOGF_DEBUG("GuideSouth truncating %dms pulse to %dms", ms, MAX_LX200AP_PULSE_LEN);
ms = MAX_LX200AP_PULSE_LEN;
}
// Clamp to within 1 to 9999
ms = std::clamp(ms, 1u, MAX_LX200AP_PULSE_LEN);

if (usePulseCommand)
{
APSendPulseCmd(PortFD, LX200_SOUTH, ms);
Expand Down Expand Up @@ -1331,11 +1326,9 @@ IPState LX200AstroPhysicsV2::GuideEast(uint32_t ms)
GuideWETID = 0;
}

if (ms > MAX_LX200AP_PULSE_LEN)
{
LOGF_DEBUG("GuideEast truncating %dms pulse to %dms", ms, MAX_LX200AP_PULSE_LEN);
ms = MAX_LX200AP_PULSE_LEN;
}
// Clamp to within 1 to 9999
ms = std::clamp(ms, 1u, MAX_LX200AP_PULSE_LEN);

if (usePulseCommand)
{
APSendPulseCmd(PortFD, LX200_EAST, ms);
Expand Down Expand Up @@ -1363,11 +1356,9 @@ IPState LX200AstroPhysicsV2::GuideWest(uint32_t ms)
GuideWETID = 0;
}

if (ms > MAX_LX200AP_PULSE_LEN)
{
LOGF_DEBUG("GuideWest truncating %dms pulse to %dms", ms, MAX_LX200AP_PULSE_LEN);
ms = MAX_LX200AP_PULSE_LEN;
}
// Clamp to within 1 to 9999
ms = std::clamp(ms, 1u, MAX_LX200AP_PULSE_LEN);

if (usePulseCommand)
{
APSendPulseCmd(PortFD, LX200_WEST, ms);
Expand Down
2 changes: 1 addition & 1 deletion drivers/telescope/lx200telescope.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class LX200Telescope : public INDI::Telescope, public INDI::GuiderInterface, pub
/* Use pulse-guide commands */
ISwitchVectorProperty UsePulseCmdSP;
ISwitch UsePulseCmdS[2];
bool usePulseCommand { false };
bool usePulseCommand { true };

/* Site Management */
ISwitchVectorProperty SiteSP;
Expand Down

0 comments on commit 246abcd

Please sign in to comment.