rig_set_mode for non-targetable rigs will only set mode on VFOB once per run unless mode is changed

This allows subsequent rig_set_mode to execute quickly without any VFO juggling
If user twiddles with VFOB mode they are on their own
https://github.com/Hamlib/Hamlib/issues/872
Hamlib-4.4
Mike Black W9MDB 2021-11-22 16:54:22 -06:00
rodzic 3fb9f50003
commit 238e17b736
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -2354,8 +2354,8 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
ELAPSED1;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%d\n", __func__,
rig_strvfo(vfo), rig_strrmode(mode), (int)width);
rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%dm, curr_vfo=%s\n", __func__,
rig_strvfo(vfo), rig_strrmode(mode), (int)width, rig_strvfo(rig->state.current_vfo));
if (CHECK_RIG_ARG(rig))
{
@ -2392,6 +2392,12 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
int rc2;
vfo_t curr_vfo;
// if not a targetable rig we will only set mode on VFOB if it is changing
if (rig->state.cache.modeMainB == mode)
{
rig_debug(RIG_DEBUG_TRACE, "%s: VFOB mode not changing so ignoring\n", __func__);
return(RIG_OK);
}
rig_debug(RIG_DEBUG_TRACE, "%s: not targetable need vfo swap\n", __func__);
if (!caps->set_vfo)