From cf956daf17ee0099b9151002ece37ce1d268f911 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Mon, 20 Mar 2023 23:20:40 -0500 Subject: [PATCH] Clean up id5100.c --- rigs/icom/id5100.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index a3e3cc41b..e58586cbc 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -20,15 +20,12 @@ * */ -#include - #include "hamlib/rig.h" #include "idx_builtin.h" #include "icom.h" #include "icom_defs.h" #include "frame.h" #include "misc.h" -#include "tones.h" /* * Specs and protocol details comes from the chapter 13 of ID-5100_Full-Inst_Manual.pdf @@ -147,39 +144,30 @@ int id5100_set_vfo(RIG *rig, vfo_t vfo) //struct icom_priv_data *priv = (struct icom_priv_data *) rs->priv; ENTERFUNC; - - if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } - + if (vfo == RIG_VFO_CURR) vfo = rig->state.current_vfo; if (vfo == RIG_VFO_A || vfo == RIG_VFO_B) { // then we need to turn off dual watch - - if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, - 0))) + + if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, 0))) { RETURNFUNC2(retval); } } else if (vfo == RIG_VFO_MAIN || vfo == RIG_VFO_SUB) - if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, - 1))) + if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, 1))) { RETURNFUNC2(retval); } - int myvfo = S_MAIN; - if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) { myvfo = S_SUB; } - - if (RIG_OK != (retval = icom_transaction(rig, C_SET_VFO, myvfo, NULL, 0, ackbuf, - &ack_len))) + if (RIG_OK != (retval = icom_transaction(rig, C_SET_VFO, myvfo, NULL, 0, ackbuf, &ack_len))) { RETURNFUNC2(retval); } - return retval; } @@ -194,10 +182,7 @@ int id5100_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_A || vfo == RIG_VFO_B) - { - return id5100_set_vfo(rig, vfo); - } - + return icom_set_vfo(rig,vfo); if (vfo == RIG_VFO_MAIN) { retval = RIG_OK; @@ -206,7 +191,6 @@ int id5100_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) { retval = RIG_OK; } - return retval; }