From 21cc26b4771c0cd0a5734823c776dd837e413873 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 21 Feb 2016 13:59:39 +0000 Subject: [PATCH] Elide unnecessary CAT commands when setting split frequency and mode --- icom/icom.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/icom/icom.c b/icom/icom.c index 846a9f2f0..b02087d59 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -2078,13 +2078,18 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, rmode_t tx_mod if (status != RIG_OK) return status; - status = rig_set_freq(rig, RIG_VFO_CURR, tx_freq); - if (status != RIG_OK) - return status; + if (tx_freq != second_freq) { + status = rig_set_freq(rig, RIG_VFO_CURR, tx_freq); + if (status != RIG_OK) + return status; + } - status = rig->caps->set_mode(rig, RIG_VFO_CURR, tx_mode, tx_width); - if (status != RIG_OK) - return status; + if (tx_mode != second_mode + || (tx_width != RIG_PASSBAND_NORMAL && tx_width != second_width)) { + status = rig->caps->set_mode(rig, RIG_VFO_CURR, tx_mode, tx_width); + if (status != RIG_OK) + return status; + } if (second_freq != orig_freq || second_mode != orig_mode || second_width != orig_width) { /* RX VFO must have been selected when we started so switch back