From: Bartosz Golaszewski Date: Wed, 1 Jul 2015 08:47:38 +0000 (+0200) Subject: baylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd. X-Git-Tag: libsigrok-0.4.0~470 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7a1a3a36a98eda90c2fe4a78326ea68afe94a041;p=libsigrok.git baylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/hardware/baylibre-acme/api.c b/src/hardware/baylibre-acme/api.c index 6ec4d749..72e8f345 100644 --- a/src/hardware/baylibre-acme/api.c +++ b/src/hardware/baylibre-acme/api.c @@ -374,7 +374,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) } tspec.it_interval.tv_sec = 0; - tspec.it_interval.tv_nsec = (1000000000L / devc->samplerate); + tspec.it_interval.tv_nsec = SR_HZ_TO_NS(devc->samplerate); tspec.it_value = tspec.it_interval; if (timerfd_settime(devc->timer_fd, 0, &tspec, NULL)) {