[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 21b9aadb91db8c2c45748
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-04-24 04:39:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 21b9aadb91db8c2c4574812ba442c830664b58a0 (commit) via 0a4e0dbdfb5d169b0c8c126d476a4bead152e6dd (commit) via 295daa791b922b837598ef4439ca5f3730329529 (commit) via 1d79b9e01cae5a474d73b568cd1b2cc6f5222851 (commit) from b6a29f1e165fe53f1dff1f85d67cd3a8c178dda1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 21b9aadb91db8c2c4574812ba442c830664b58a0 Merge: 0a4e0dbd 295daa79 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 23 23:39:02 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 0a4e0dbdfb5d169b0c8c126d476a4bead152e6dd Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 23 23:37:44 2021 -0500 Fix RIT in kenwood.c -- default to 10Hz steps if rig step setting works https://github.com/Hamlib/Hamlib/issues/677 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e6f4e062..12b20038 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -782,18 +782,6 @@ int kenwood_open(RIG *rig) "%s: no response to get_id from rig...continuing anyways.\n", __func__); } - if (RIG_IS_TS2000 - || RIG_IS_TS480 - || RIG_IS_TS590S - || RIG_IS_TS590SG - || RIG_IS_TS890S - || RIG_IS_TS990S) - { - // rig has Set 2 RIT/XIT function - rig_debug(RIG_DEBUG_TRACE, "%s: rig has_rit2\n", __func__); - priv->has_rit2 = 1; - } - if (RIG_IS_TS590S) { /* we need the firmware version for these rigs to deal with f/w defects */ @@ -1733,11 +1721,10 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) int retval, i; shortfreq_t curr_rit; int diff; - struct kenwood_priv_data *priv = rig->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld, has_rit2=%d\n", + rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld\n", __func__, - rig_strvfo(vfo), rit, priv->has_rit2); + rig_strvfo(vfo), rit); retval = kenwood_get_rit(rig, vfo, &curr_rit); @@ -1746,32 +1733,24 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) RETURNFUNC(retval); } - if (priv->has_rit2) // if backend shows it has the Set 2 command + // we'll set the rigs that have a rit step setting to 10Hz steps + retval = kenwood_transaction(rig, "RC;RU00010", NULL, 0); + + if (retval != RIG_OK) { - char cmd[15]; // length required to make Apple-gcc happy (unicode-proof). - snprintf(cmd, sizeof(cmd) - 1, "R%c%05d", rit > 0 ? 'U' : 'D', abs((int)rit)); - retval = kenwood_transaction(rig, cmd, NULL, 0); + RETURNFUNC(retval); } - else - { - retval = kenwood_transaction(rig, "RC", NULL, 0); - if (retval != RIG_OK) - { - RETURNFUNC(retval); - } + if (rit == 0) { RETURNFUNC(RIG_OK); } // we're done here - if (rit == 0) { RETURNFUNC(RIG_OK); } // we're done here + snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); - snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); + diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest + rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); - diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest - rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); - - for (i = 0; i < diff; i++) - { - retval = kenwood_transaction(rig, buf, NULL, 0); - } + for (i = 0; i < diff; i++) + { + retval = kenwood_transaction(rig, buf, NULL, 0); } RETURNFUNC(retval); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index fc2e7654..a2f197e4 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210406" +#define BACKEND_VER "20210423" #define EOM_KEN ';' #define EOM_TH '\r' @@ -133,7 +133,6 @@ struct kenwood_priv_data struct timespec cache_start; char last_if_response[KENWOOD_MAX_BUF_LEN]; int poweron; /* to avoid powering on more than once */ - int has_rit2; /* rig has set 2 rit command */ int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ int micgain_min, micgain_max; /* varies by rig so we figure it out automagically */ int is_k2; commit 295daa791b922b837598ef4439ca5f3730329529 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 23 23:37:44 2021 -0500 Fix RIT in kenwood.c -- default to 10Hz steps if rig step setting works diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e6f4e062..12b20038 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -782,18 +782,6 @@ int kenwood_open(RIG *rig) "%s: no response to get_id from rig...continuing anyways.\n", __func__); } - if (RIG_IS_TS2000 - || RIG_IS_TS480 - || RIG_IS_TS590S - || RIG_IS_TS590SG - || RIG_IS_TS890S - || RIG_IS_TS990S) - { - // rig has Set 2 RIT/XIT function - rig_debug(RIG_DEBUG_TRACE, "%s: rig has_rit2\n", __func__); - priv->has_rit2 = 1; - } - if (RIG_IS_TS590S) { /* we need the firmware version for these rigs to deal with f/w defects */ @@ -1733,11 +1721,10 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) int retval, i; shortfreq_t curr_rit; int diff; - struct kenwood_priv_data *priv = rig->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld, has_rit2=%d\n", + rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld\n", __func__, - rig_strvfo(vfo), rit, priv->has_rit2); + rig_strvfo(vfo), rit); retval = kenwood_get_rit(rig, vfo, &curr_rit); @@ -1746,32 +1733,24 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) RETURNFUNC(retval); } - if (priv->has_rit2) // if backend shows it has the Set 2 command + // we'll set the rigs that have a rit step setting to 10Hz steps + retval = kenwood_transaction(rig, "RC;RU00010", NULL, 0); + + if (retval != RIG_OK) { - char cmd[15]; // length required to make Apple-gcc happy (unicode-proof). - snprintf(cmd, sizeof(cmd) - 1, "R%c%05d", rit > 0 ? 'U' : 'D', abs((int)rit)); - retval = kenwood_transaction(rig, cmd, NULL, 0); + RETURNFUNC(retval); } - else - { - retval = kenwood_transaction(rig, "RC", NULL, 0); - if (retval != RIG_OK) - { - RETURNFUNC(retval); - } + if (rit == 0) { RETURNFUNC(RIG_OK); } // we're done here - if (rit == 0) { RETURNFUNC(RIG_OK); } // we're done here + snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); - snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); + diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest + rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); - diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest - rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); - - for (i = 0; i < diff; i++) - { - retval = kenwood_transaction(rig, buf, NULL, 0); - } + for (i = 0; i < diff; i++) + { + retval = kenwood_transaction(rig, buf, NULL, 0); } RETURNFUNC(retval); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index fc2e7654..a2f197e4 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210406" +#define BACKEND_VER "20210423" #define EOM_KEN ';' #define EOM_TH '\r' @@ -133,7 +133,6 @@ struct kenwood_priv_data struct timespec cache_start; char last_if_response[KENWOOD_MAX_BUF_LEN]; int poweron; /* to avoid powering on more than once */ - int has_rit2; /* rig has set 2 rit command */ int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ int micgain_min, micgain_max; /* varies by rig so we figure it out automagically */ int is_k2; commit 1d79b9e01cae5a474d73b568cd1b2cc6f5222851 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 23 17:43:54 2021 -0500 Fix icom \get_mode in non-vfo mode to stay on VFOB/Sub https://github.com/Hamlib/Hamlib/issues/676 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 3654039b..85f3a7db 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2108,8 +2108,8 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A | RIG_VFO_CURR)) { - // then we get our current vfo..i.e. VFOA - if (rig->state.current_vfo != RIG_VFO_A) + // then we get what was asked for + if (vfo == RIG_VFO_NONE) { rig_debug(RIG_DEBUG_TRACE, "%s(%d): forcing default VFO_A\n", __func__, __LINE__); diff --git a/src/rig.c b/src/rig.c index 82e7d1e6..924ab4a3 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1895,6 +1895,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) vfo = vfo_fixup(rig, vfo); + if (vfo == RIG_VFO_CURR) vfo = curr_vfo; + // we ignore get_freq for the uplink VFO for gpredict to behave better if ((rig->state.uplink == 1 && vfo == RIG_VFO_SUB) || (rig->state.uplink == 2 && vfo == RIG_VFO_MAIN)) ----------------------------------------------------------------------- Summary of changes: rigs/icom/icom.c | 4 ++-- rigs/kenwood/kenwood.c | 49 ++++++++++++++----------------------------------- rigs/kenwood/kenwood.h | 3 +-- src/rig.c | 2 ++ 4 files changed, 19 insertions(+), 39 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |