Fix cache clear on rigs without get_vfo to only clear cache when vfo is changing

pull/1119/head
Mike Black W9MDB 2022-09-03 16:56:48 -05:00
rodzic 81f489b969
commit 0cd6f1f761
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -2750,8 +2750,9 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0);
}
if (rig_get_vfo(rig, &tmp_vfo) == -RIG_ENAVAIL)
if (vfo != rig->state.current_vfo && rig_get_vfo(rig, &tmp_vfo) == -RIG_ENAVAIL)
{
rig_debug(RIG_DEBUG_TRACE, "%s: Expiring all cache due to VFO change and no get_vfo\n", __func__);
// expire all cached items when we switch VFOs and get_vfo does not work
rig_set_cache_freq(rig, RIG_VFO_ALL, 0);
}