Add FT-DX101D as a rig that can't get VFOA freq while VFOB is transmitting

Move the IC910 of the same problem to rig.c instead of icom.c
Eventually this may become a backend flag
https://github.com/Hamlib/Hamlib/issues/279
pull/290/head
Michael Black W9MDB 2020-06-03 18:12:17 -05:00
rodzic 653d7d1030
commit 4502769c8d
3 zmienionych plików z 33 dodań i 24 usunięć

Wyświetl plik

@ -1057,25 +1057,6 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rs = &rig->state;
priv = (struct icom_priv_data *) rs->priv;
if (rig->caps->rig_model == RIG_MODEL_IC910)
{
ptt_t ptt;
retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
if (retval != RIG_OK)
{
return retval;
}
if (ptt)
{
rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning last known freq\n",
__func__);
*freq = priv->vfoa_freq;
return RIG_OK;
}
}
#if 0 // disabled to test if IC9700 satmode/gpredict still works OK
if (priv->curr_vfo == RIG_VFO_NONE)

Wyświetl plik

@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
#define BACKEND_VER "20200601"
#define BACKEND_VER "20200603"
/*
* defines used by comp_cal_str in rig.c

Wyświetl plik

@ -936,17 +936,20 @@ int HAMLIB_API rig_open(RIG *rig)
if (backend_num == RIG_ICOM)
{
rig_debug(RIG_DEBUG_TRACE, "%s: Icom rig so default vfo = %s\n", __func__, rig_strvfo(rs->current_vfo));
rig_debug(RIG_DEBUG_TRACE, "%s: Icom rig so default vfo = %s\n", __func__,
rig_strvfo(rs->current_vfo));
}
else if (rig->caps->set_vfo == NULL)
{ // for non-Icom rigs if there's no set_vfo then we need to set one
{
// for non-Icom rigs if there's no set_vfo then we need to set one
rs->current_vfo = vfo_fixup(rig, RIG_VFO_A);
rig_debug(RIG_DEBUG_TRACE, "%s: No set_vfo function rig so default vfo = %s\n",
__func__, rig_strvfo(rs->current_vfo));
}
else
{
rig_debug(RIG_DEBUG_TRACE, "%s: default vfo = %s\n", __func__, rig_strvfo(rs->current_vfo));
rig_debug(RIG_DEBUG_TRACE, "%s: default vfo = %s\n", __func__,
rig_strvfo(rs->current_vfo));
}
}
@ -1421,6 +1424,30 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
vfo = vfo_fixup(rig, vfo);
// there are some rigs that can't get VFOA freq while VFOB is transmitting
// so we'll return the cached VFOA freq for them
// should we use the cached ptt maybe?
if (vfo == RIG_VFO_A && rig->state.cache.split &&
(rig->caps->rig_model == RIG_MODEL_FTDX101D || rig->caps->rig_model == RIG_MODEL_IC910))
{ // if we're in PTT don't get VFOA freq -- otherwise we interrupt transmission
ptt_t ptt;
retcode = rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
if (retcode != RIG_OK)
{
return retcode;
}
if (ptt)
{
rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning VFOA last known freq\n",
__func__);
*freq = rig->state.cache.freq;
return RIG_OK;
}
}
cache_ms = elapsed_ms(&rig->state.cache.time_freq, ELAPSED_GET);
rig_debug(RIG_DEBUG_TRACE, "%s: cache check age=%dms\n", __func__, cache_ms);
@ -1454,7 +1481,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (vfo == RIG_VFO_CURR && caps->set_vfo == NULL)
{
vfo = vfo_fixup(rig, RIG_VFO_A);
rig_debug(RIG_DEBUG_TRACE, "%s: no set_vfo so vfo=%s\n", __func__, rig_strvfo(vfo));
rig_debug(RIG_DEBUG_TRACE, "%s: no set_vfo so vfo=%s\n", __func__,
rig_strvfo(vfo));
}
retcode = caps->get_freq(rig, vfo, freq);