From 0aeadaa213e16c60e3044fd4cccb45fe60551714 Mon Sep 17 00:00:00 2001 From: TT Date: Sun, 29 Sep 2019 11:19:20 +0900 Subject: [PATCH] fix: #52. Previous fix 4e2036b was incomplete. --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index a9adaf09..52cb0a65 100644 --- a/main.c +++ b/main.c @@ -758,8 +758,10 @@ set_frequencies(uint32_t start, uint32_t stop, int16_t points) { int i; float span = stop - start; - for (i = 0; i < points; i++) - frequencies[i] = start + i * span / (float)(points - 1); + for (i = 0; i < points; i++) { + float offset = i * span / (float)(points - 1); + frequencies[i] = start + (uint32_t)offset; + } // disable at out of sweep range for (; i < sweep_points; i++) frequencies[i] = 0;