Skip to content

Commit

Permalink
Use try catch when shutting down EQMod. Fixes #759
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed May 25, 2023
1 parent 2b52a23 commit b7ef5e4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions indi-eqmod/skywatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,17 @@ bool Skywatcher::Disconnect()
{
if (PortFD < 0)
return true;
StopMotor(Axis1);
StopMotor(Axis2);
// Deactivate motor (for geehalel mount only)
/*
if (MountCode == 0xF0) {
dispatch_command(Deactivate, Axis1, nullptr);
//read_eqmod();

try
{
StopMotor(Axis1);
StopMotor(Axis2);
}
*/
catch (EQModError)
{
// Ignore error
}

return true;
}

Expand Down Expand Up @@ -2003,7 +2005,8 @@ bool Skywatcher::dispatch_command(SkywatcherCommand cmd, SkywatcherAxis axis, ch
{
if (i > 0)
{
LOGF_WARN("%s() : serial port read failed for %dms (%d retries), verify mount link.", __FUNCTION__, (i*EQMOD_TIMEOUT)/1000, i);
LOGF_WARN("%s() : serial port read failed for %dms (%d retries), verify mount link.", __FUNCTION__,
(i * EQMOD_TIMEOUT) / 1000, i);
}
return true;
}
Expand Down

0 comments on commit b7ef5e4

Please sign in to comment.