From b0fcd87f7feafa0d9b9914d8d13aff68ba10e8cf Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sat, 29 Feb 2020 16:24:31 -0600 Subject: [PATCH 1/2] Add satmode rig logic to set_split_freq --- rigs/icom/icom.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 4d9094dbd..ae7fd9a3f 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -3370,7 +3370,7 @@ int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo) int satmode = 0; // e.g. IC9700 split on Main/Sub does not work // only Main VFOA/B and SubRx/MainTx split works - rig_get_func((RIG*)rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); + rig_get_func((RIG *)rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); // don't care about retval here...only care about satmode=1 if (satmode) @@ -3417,10 +3417,12 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) struct rig_state *rs; unsigned char ackbuf[MAXFRAMELEN]; int ack_len = sizeof(ackbuf); + vfo_t save_vfo; rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, rig_strvfo(vfo)); rs = &rig->state; priv = (struct icom_priv_data *) rs->priv; + save_vfo = priv->curr_vfo; if (!priv->no_xchg && rig_has_vfo_op(rig, RIG_OP_XCHG)) { @@ -3487,12 +3489,11 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (VFO_HAS_MAIN_SUB_A_B_ONLY) { - // Then we leave the VFO on the tx_vfo which should be Main - // in satellite mode + // Then we return the VFO to where it was rig_debug(RIG_DEBUG_TRACE, "%s: SATMODE rig so setting vfo to %s\n", __func__, - rig_strvfo(tx_vfo)); + rig_strvfo(save_vfo)); - if (RIG_OK != (rc = icom_set_vfo(rig, tx_vfo))) + if (RIG_OK != (rc = icom_set_vfo(rig, save_vfo))) { return rc; } From 8981201e4b53d161d90db293fb07cefdc05cdd89 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sun, 1 Mar 2020 08:11:07 -0600 Subject: [PATCH 2/2] Add ic9700 logic to set_vfo_curr --- rigs/icom/icom.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index ae7fd9a3f..320c5148f 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -3426,6 +3426,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (!priv->no_xchg && rig_has_vfo_op(rig, RIG_OP_XCHG)) { + rig_debug(RIG_DEBUG_TRACE,"%s: Using XCHG to swap/set/swap\n", __func__); if (RIG_OK != (rc = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { return rc; @@ -3515,6 +3516,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) } } + // Update our internal freqs to match what we just did if (vfo == RIG_VFO_MAIN) { priv->main_freq = tx_freq; @@ -6373,6 +6375,20 @@ static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo) if (priv->curr_vfo == RIG_VFO_NONE && vfo == RIG_VFO_CURR) { + if (VFO_HAS_MAIN_SUB_A_B_ONLY) + { + rig_debug(RIG_DEBUG_TRACE, "%s: setting default as MAIN/VFOA\n", + __func__); + retval = rig_set_vfo(rig, RIG_VFO_MAIN); // we'll default to Main in this case + + if (retval != RIG_OK) + { + return retval; + } + + retval = rig_set_vfo(rig, RIG_VFO_A); // we'll default to Main in this case + } + if (VFO_HAS_MAIN_SUB_ONLY) { rig_debug(RIG_DEBUG_TRACE, "%s: setting default as MAIN\n",