Skip to content

Commit

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

0 comments on commit 0aeadaa

Please sign in to comment.