]> sigrok.org Git - libsigrok.git/commitdiff
baylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd.
authorBartosz Golaszewski <redacted>
Wed, 1 Jul 2015 08:47:38 +0000 (10:47 +0200)
committerBartosz Golaszewski <redacted>
Wed, 1 Jul 2015 08:47:38 +0000 (10:47 +0200)
Signed-off-by: Bartosz Golaszewski <redacted>
src/hardware/baylibre-acme/api.c

index 6ec4d7492ddb7d5d5be7e8c41111dc172ae1c825..72e8f345b870d04d35a52cd6994eabc225bbdcb9 100644 (file)
@@ -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)) {