From 18d3bf79fa14b8b85b7e54f4ab80b5d75dfd2ae2 Mon Sep 17 00:00:00 2001 From: Pedro Luis Castedo Cepeda Date: Sun, 22 Apr 2018 18:19:00 +0200 Subject: [PATCH] Replace deprcated usleep with nanosleep Signed-off-by: Pedro Luis Castedo Cepeda --- libindi/drivers/telescope/lx200_OnStep.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libindi/drivers/telescope/lx200_OnStep.cpp b/libindi/drivers/telescope/lx200_OnStep.cpp index eddf4a2a36..1fcc74364c 100644 --- a/libindi/drivers/telescope/lx200_OnStep.cpp +++ b/libindi/drivers/telescope/lx200_OnStep.cpp @@ -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)) { @@ -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#"); @@ -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#");