Skip to content

Commit

Permalink
EQMod: fix driver crash when enabling PEC with no PEC data trained (#648
Browse files Browse the repository at this point in the history
)
  • Loading branch information
k-ross authored and knro committed Sep 20, 2022
1 parent a01742e commit dc45f67
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion indi-eqmod/skywatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,22 @@ void Skywatcher::TurnPPEC(bool on)
command = TURN_PPEC_ON_CMD;
else
command = TURN_PPEC_OFF_CMD;
SetFeature(Axis1, command);
try
{
SetFeature(Axis1, command);
}
catch(EQModError e)
{
if (on)
{
if (e.severity == EQModError::ErrCmdFailed && response[1] == '8')
LOG_ERROR("Can't enable PEC: no PEC data");
else
LOGF_ERROR("Can't enable PEC: %s", e.message);
}
else
LOG_ERROR(e.message);
}
}

void Skywatcher::GetPPECStatus(bool *intraining, bool *inppec)
Expand Down

0 comments on commit dc45f67

Please sign in to comment.