In rig_set_vfo query vfo first to see if it needs to be changed.

Doing VS0 on an FTDX-3000 was causing VFOA to mute
https://github.com/Hamlib/Hamlib/issues/903
pull/943/head
Mike Black W9MDB 2022-01-19 15:40:08 -06:00
rodzic ed4a667f77
commit 970d253866
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -2379,6 +2379,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
const struct rig_caps *caps;
int retcode;
freq_t curr_freq;
vfo_t curr_vfo;
ELAPSED1;
ENTERFUNC;
@ -2404,6 +2405,13 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
if (vfo == RIG_VFO_CURR) { RETURNFUNC(RIG_OK); }
retcode = rig_get_vfo(rig, &curr_vfo);
if (retcode != RIG_OK)
{
rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%s\n", __func__, rigerror(retcode));
}
if (curr_vfo == vfo) { RETURNFUNC(RIG_OK); }
#if 0 // removing this check 20210801 -- should be mapped already
// make sure we are asking for a VFO that the rig actually has
@ -2436,8 +2444,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
{
rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_vfo due to VFO twiddling\n",
__func__);
RETURNFUNC(
RIG_OK); // would be better as error but other software won't handle errors
RETURNFUNC(RIG_OK); // would be better as error but other software won't handle errors
}
TRACE;