From 8a8b10634cf9bdcb28f53c0ac509b57219cdafc0 Mon Sep 17 00:00:00 2001 From: Jasem Mutlaq Date: Sun, 22 Apr 2018 12:03:31 +0300 Subject: [PATCH 1/2] Doh I reversed the arguments --- 3rdparty/indi-gphoto/gphoto_driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/indi-gphoto/gphoto_driver.cpp b/3rdparty/indi-gphoto/gphoto_driver.cpp index a52c8418f7..e9503fdc9d 100644 --- a/3rdparty/indi-gphoto/gphoto_driver.cpp +++ b/3rdparty/indi-gphoto/gphoto_driver.cpp @@ -456,7 +456,7 @@ static void *stop_bulb(void *arg) if (gphoto->command & DSLR_CMD_BULB_CAPTURE) { gettimeofday(&curtime, nullptr); - timersub(&curtime, &gphoto->bulb_end, &diff); + timersub(&gphoto->bulb_end, &curtime, &diff); timeleft = diff.tv_sec * 1000 + diff.tv_usec / 1000; DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Time left: %ld ms", timeleft); } 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 2/2] 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#");