From a7b9620f910e2270caca7a2381d200615560bbcc Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Fri, 15 Jan 2021 17:29:02 -0600 Subject: [PATCH] Make band_index detect change by VFO https://github.com/Hamlib/Hamlib/issues/510 --- rigs/yaesu/newcat.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ef520dd7f..381169545 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -806,8 +806,20 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // // Restore band memory if we can and band is changing -- we do it before we set the frequency // And only when not in split mode (note this check has been removed for testing) - if (newcat_valid_command(rig, "BS") - && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq) + int changing; + + if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) + { + changing = newcat_band_index(freq) != rig->state.cache.freqMainA; + rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing); + } + else + { + changing = newcat_band_index(freq) != rig->state.cache.freqMainB; + rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing); + } + + if (newcat_valid_command(rig, "BS") && changing // remove the split check here -- hopefully works OK //&& !rig->state.cache.split && !is_ft891) // 891 does not remember bandwidth so don't do this