From 7e6adc6d2a69e6bb41809f59e9103c8cc156fae3 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 24 Jan 2021 12:25:29 -0600 Subject: [PATCH] Prevent ftdx101d from setting frequency on the non-tx vfo when in split mode --- rigs/yaesu/newcat.c | 15 +++++++++++++-- rigs/yaesu/newcat.h | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3d9c04ea5..e07733672 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -775,6 +775,15 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) target_vfo = 'A' == c ? '0' : '1'; + // some rigs like FTDX101D cannot change non-TX vfo freq + // but they can change the TX vfo + if (is_ftdx101 && rig->state.cache.ptt == RIG_PTT_ON) + { + // then we can't change freq on the non-tx VFO + rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); + if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET; + } + if (rig->state.cache.ptt == RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON { @@ -6687,6 +6696,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) /* * newcat_set_tx_vfo does not set priv->curr_vfo + * does set rig->state.tx_vfo */ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) { @@ -6762,9 +6772,10 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term); - rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); + rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str, rig_strvfo(tx_vfo)); + + rig->state.tx_vfo = tx_vfo; - /* Set TX VFO */ RETURNFUNC(newcat_set_cmd(rig)); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bf6005aed..ba2e50965 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210123" +#define NEWCAT_VER "20210124" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129