Do not ask for freq in rig_set_vfo unless we can set the VFO succesfully

pull/252/head
Michael Black W9MDB 2020-05-09 10:22:46 -05:00
rodzic 9701eb1c73
commit 8e744a4ad7
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -1816,9 +1816,14 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
rig->state.current_vfo = vfo;
rig->state.cache.vfo = vfo;
}
else
{
rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed with '%s'\n", __func__, strerror(retcode));
}
// we need to update our internal freq to avoid getting detected as twiddling
if (caps->get_freq) { retcode = rig_get_freq(rig, vfo, &curr_freq); }
// we only get the freq if we set the vfo OK
if (retcode == RIG_OK && caps->get_freq) { retcode = rig_get_freq(rig, vfo, &curr_freq); }
// expire several cached items when we switch VFOs
elapsed_ms(&rig->state.cache.time_vfo, ELAPSED_INVALIDATE);