From: Bert Vermeulen Date: Fri, 12 Apr 2013 17:42:44 +0000 (+0200) Subject: rigol-ds1xx2: Use g_usleep() for portability X-Git-Tag: dsupstream~165 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8f35be72b46769b3b51e9c91a131eaf6c256ac1a;p=libsigrok.git rigol-ds1xx2: Use g_usleep() for portability --- diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index cdbdaad6..e38105b6 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include "libsigrok.h" #include "libsigrok-internal.h" @@ -158,7 +157,6 @@ static int clear_instances(void) static int set_cfg(const struct sr_dev_inst *sdi, const char *format, ...) { struct dev_context *devc; - struct timespec delay; va_list args; char buf[256]; @@ -172,10 +170,8 @@ static int set_cfg(const struct sr_dev_inst *sdi, const char *format, ...) /* When setting a bunch of parameters in a row, the DS1052E scrambles * some of them unless there is at least 100ms delay in between. */ - delay.tv_sec = 0; - delay.tv_nsec = 100000000L; - sr_spew("delay %dms", delay.tv_nsec / 1000000); - nanosleep(&delay, NULL); + sr_spew("delay %dms", 100); + g_usleep(100); return SR_OK; }