This commit is contained in:
TT 2019-09-28 21:49:59 +09:00
parent 0d36621411
commit 4e2036ba36

5
main.c
View file

@ -755,9 +755,10 @@ void
set_frequencies(uint32_t start, uint32_t stop, int16_t points)
{
int i;
uint32_t span = (stop - start) / 1000; /* prevents overflow because of maximum of int32_t(2.147e+9) */
float span = stop - start;
for (i = 0; i < points; i++)
frequencies[i] = start + span * i / (points - 1) * 1000;
frequencies[i] = start + i * span / (float)(points - 1);
// disable at out of sweep range
for (; i < sweep_points; i++)
frequencies[i] = 0;
}