Skip to content

Commit

Permalink
fix: #52
Browse files Browse the repository at this point in the history
  • Loading branch information
edy555 committed Sep 28, 2019
1 parent 0d36621 commit 4e2036b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4e2036b

Please sign in to comment.