From 86a24c5a187f4539c6280bb580e66087bccf8174 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 22 Mar 2016 21:37:33 +0000 Subject: [PATCH] Make sure right band is used when setting frequency on IC-910(H) --- icom/ic910.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/icom/ic910.c b/icom/ic910.c index 685438d25..afc243ce7 100644 --- a/icom/ic910.c +++ b/icom/ic910.c @@ -208,6 +208,18 @@ static int ic910_set_freq(RIG *rig, vfo_t vfo, freq_t freq) else if (RIG_VFO_CURR == vfo) { retval = icom_set_freq (rig, RIG_VFO_CURR, freq); + if (-RIG_ERJCTED == retval) + { + /* exchange MAIN & SUB */ + if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) return retval; + retval = icom_set_freq (rig, RIG_VFO_CURR, freq); + if (-RIG_ERJCTED == retval) + { + /* band not fitted so swap MAIN & SUB back and give up */ + icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG); + return retval; + } + } } else retval = -RIG_EVFO; }