From ee6703107f8aecc47effafd1f21291fbb35d3fd5 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 7 Jun 2020 23:31:20 -0500 Subject: [PATCH] Fix 'f VFOB' staying on VFOB instead of reverting to VFOA when VFOA is current VFO --- src/rig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rig.c b/src/rig.c index 18c8b2ddf..0db77f89b 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1415,6 +1415,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) const struct rig_caps *caps; int retcode; int cache_ms; + vfo_t curr_vfo; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); @@ -1424,6 +1425,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return -RIG_EINVAL; } + curr_vfo = rig->state.current_vfo; // save vfo for restore later + vfo = vfo_fixup(rig, vfo); // there are some rigs that can't get VFOA freq while VFOB is transmitting @@ -1530,14 +1533,11 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) else { int rc2; - vfo_t curr_vfo; - if (!caps->set_vfo) { return -RIG_ENAVAIL; } - curr_vfo = rig->state.current_vfo; retcode = caps->set_vfo(rig, vfo); if (retcode != RIG_OK)