Skip to content

Commit

Permalink
Merge pull request #577 from gitplcc/develop
Browse files Browse the repository at this point in the history
Replace deprecated usleep with nanosleep
  • Loading branch information
knro authored Apr 22, 2018
2 parents 8a8b106 + 18d3bf7 commit 7f578ea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libindi/drivers/telescope/lx200_OnStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[
BacklashNP.s = IPS_ALERT;
IDSetNumber(&BacklashNP, "Error Backlash DEC limit.");
}
usleep(100000); // time for OnStep to respond to previous cmd
const struct timespec timeout = {0, 100000000L};
nanosleep(&timeout, NULL); // time for OnStep to respond to previous cmd
snprintf(cmd, 9, ":$BR%d#", (int)bklshra);
if (sendOnStepCommand(cmd))
{
Expand Down Expand Up @@ -709,7 +710,8 @@ bool LX200_OnStep::ISNewSwitch(const char *dev, const char *name, ISState *state
strcpy(cmd, ":FQ#");
}
sendOnStepCommandBlind(cmd);
usleep(100000); // Pulse 0,1 s
const struct timespec timeout = {0, 100000000L};
nanosleep(&timeout, NULL); // Pulse 0,1 s
if(index != 2)
{
sendOnStepCommandBlind(":FQ#");
Expand Down Expand Up @@ -756,7 +758,8 @@ bool LX200_OnStep::ISNewSwitch(const char *dev, const char *name, ISState *state
strcpy(cmd, ":fQ#");
}
sendOnStepCommandBlind(cmd);
usleep(100000); // Pulse 0,1 s
const struct timespec timeout = {0, 100000000L};
nanosleep(&timeout, NULL); // Pulse 0,1 s
if(index != 2)
{
sendOnStepCommandBlind(":fQ#");
Expand Down

0 comments on commit 7f578ea

Please sign in to comment.