From: Bert Vermeulen Date: Sun, 18 Apr 2010 06:07:00 +0000 (-0700) Subject: fix broken samplerate calculation X-Git-Tag: libsigrok-0.1.0~553 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eee4890f2fac030ea77a31a3c6c478b4cb628011;p=libsigrok.git fix broken samplerate calculation --- diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 336750c4..891476ec 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -542,7 +542,7 @@ static int set_configuration_samplerate(struct sigrok_device_instance *sdi, if (supported_samplerates[i] == 0) return SIGROK_ERR_SAMPLERATE; - divider = (uint8_t) (48 / (float)(samplerate / 1000000)) - 1; + divider = (uint8_t) (48 / (samplerate / 1000000.0)) - 1; g_message("setting samplerate to %" PRIu64 " Hz (divider %d)", samplerate, divider);