Improve rig_set_freq to not rety when WSJT-X is doing it's 55Hz check

And don't confirm freq if no get_get exists
pull/573/head
Michael Black W9MDB 2021-02-26 23:53:31 -06:00
rodzic da5a4ddc6e
commit 26cfe0bb3f
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -1584,14 +1584,16 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (caps->get_freq)
{
retcode = rig_get_freq(rig, vfo, &tfreq);
// WSJT-X does a 55Hz check so we can stop early if that's the case
if ((long long)freq % 100 == 55) retry=0;
if (retcode != RIG_OK) RETURNFUNC(retcode);
if (tfreq != freq)
{
hl_usleep(50*1000);
rig_debug(RIG_DEBUG_WARN, "%s: freq not set correctly?? got %.0f asked for %.0f, retry=%d\n", __func__, (double)tfreq, (double)freq);
rig_debug(RIG_DEBUG_WARN, "%s: freq not set correctly?? got %.0f asked for %.0f, retry=%d\n", __func__, (double)tfreq, (double)freq, retry);
}
}
else { retry = 1; }
else { retry = 0; }
} while (tfreq != freq && retry-- > 0);
if (retry == 0)
{