icom.c if VFOA/B is requested for rig without VFOA/A maps to Main/Sub

https://github.com/Hamlib/Hamlib/issues/231
pull/234/head
mdblack98 2020-05-01 17:51:20 -05:00
rodzic 1aed5e9266
commit 48b0234caf
1 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -1095,10 +1095,14 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rig_debug(RIG_DEBUG_VERBOSE, "%s: using vfo=%s\n", __func__,
rig_strvfo(vfo));
if (priv->curr_vfo == RIG_VFO_NONE) {
if (priv->curr_vfo == RIG_VFO_NONE)
{
retval = rig_set_vfo(rig, vfo);
if (retval != RIG_OK) {
rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed? retval=%s\n", __func__, strerror(retval));
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed? retval=%s\n", __func__,
strerror(retval));
}
}
@ -1873,7 +1877,8 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
if ((vfo == RIG_VFO_A || vfo == RIG_VFO_B) && !VFO_HAS_A_B)
{
rig_debug(RIG_DEBUG_ERR, "%s: Rig does not have VFO A/B?\n", __func__);
return -RIG_EINVAL;
rig_debug(RIG_DEBUG_ERR, "%s: Mapping VFOA=Main, VFOB=Sub\n", __func__);
vfo = vfo == RIG_VFO_A ? RIG_VFO_A : RIG_VFO_B;
}
if ((vfo == RIG_VFO_MAIN || vfo == RIG_VFO_SUB) && !VFO_HAS_MAIN_SUB)