From a94dcddcf44c5ee1942f5c04a037edfb806f2878 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Tue, 21 Sep 2021 12:17:17 -0500 Subject: [PATCH] Fix ICOM request for VFOB info when VFOB is active vfo https://github.com/Hamlib/Hamlib/issues/806 --- rigs/icom/icom.c | 5 ++++- rigs/icom/icom.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 60daccfa0..2438fd4e3 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2193,8 +2193,10 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) && rig->caps->rig_model != RIG_MODEL_IC7800) { int vfosel = 0x00; + vfo_t vfoask = vfo_fixup(rig, vfo, 0); + vfo_t vfocurr = vfo_fixup(rig, rig->state.current_vfo, 0); - if (vfo & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) { vfosel = 0x01; } + if (vfoask != vfocurr) { vfosel = 0x01; } // use cache for the non-selected VFO -- can't get it by VFO // this avoids vfo swapping but accurate answers for these rigs @@ -6947,6 +6949,7 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) rig_strparm(parm)); RETURNFUNC(-RIG_EINVAL); } + RETURNFUNC(-RIG_EINVAL); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 9127b6e2d..acdfeed11 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include #endif -#define BACKEND_VER "20210911" +#define BACKEND_VER "20210921" #define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00)