fixed: #70 first measurement point sometimes has wrong value

This commit is contained in:
TT 2019-10-08 23:59:16 +09:00
parent 5651d1e447
commit e3a10a7868

7
main.c
View file

@ -286,12 +286,7 @@ adjust_gain(int newfreq)
int set_frequency(uint32_t freq) int set_frequency(uint32_t freq)
{ {
int delay = 0; int delay = adjust_gain(freq);
if (frequency == freq)
return delay;
delay += adjust_gain(freq);
int8_t ds = drive_strength; int8_t ds = drive_strength;
if (ds == DRIVE_STRENGTH_AUTO) { if (ds == DRIVE_STRENGTH_AUTO) {
ds = freq > FREQ_HARMONICS ? SI5351_CLK_DRIVE_STRENGTH_8MA : SI5351_CLK_DRIVE_STRENGTH_2MA; ds = freq > FREQ_HARMONICS ? SI5351_CLK_DRIVE_STRENGTH_8MA : SI5351_CLK_DRIVE_STRENGTH_2MA;