[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. a1f5d4f5e3f0b4bf93dc9
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-04-15 19:25:16
|
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 a1f5d4f5e3f0b4bf93dc980a12dcc9fac989c2ce (commit) via 7d79b59bd7ee0a3b1499c194891b80f82bf1154d (commit) from 9cb7c7dcdf296fb031e2f819aed9a2eb512a64fb (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 a1f5d4f5e3f0b4bf93dc980a12dcc9fac989c2ce Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 15 12:24:29 2021 -0500 Fix sprint_freq to show appropriate # of decimal places to get to 0.1Hz on all scales diff --git a/src/misc.c b/src/misc.c index fa097e41..1da1d651 100644 --- a/src/misc.c +++ b/src/misc.c @@ -351,6 +351,7 @@ int HAMLIB_API sprintf_freq(char *str, int nlen, freq_t freq) { double f; char *hz; + int decplaces = 10; // too verbose //rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -364,19 +365,22 @@ int HAMLIB_API sprintf_freq(char *str, int nlen, freq_t freq) { hz = "MHz"; f = (double)freq / MHz(1); + decplaces = 7; } else if (llabs(freq) >= kHz(1)) { hz = "kHz"; f = (double)freq / kHz(1); + decplaces = 4; } else { hz = "Hz"; f = (double)freq; + decplaces = 1; } - return sprintf(str, "%g %s", f, hz); + return sprintf(str, "%.*f %s", decplaces , f, hz); } commit 7d79b59bd7ee0a3b1499c194891b80f82bf1154d Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 15 11:47:58 2021 -0500 When vfo twiddling is being done set_freq calls will be skipped https://github.com/Hamlib/Hamlib/issues/664 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index cc6ceb46..12fdcae0 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2090,6 +2090,11 @@ typedef enum { HAMLIB_CACHE_WIDTH } hamlib_cache_t; +typedef enum { + TWIDDLE_OFF, + TWIDDLE_ON +} twiddle_state_t; + /** * \brief Rig cache data * @@ -2254,6 +2259,7 @@ struct rig_state { int power_max; /*!< Maximum RF power level in rig units */ unsigned char disable_yaesu_bandselect; /*!< Disables Yaeus band select logic */ int twiddle_rit; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */ + int twiddle_state; /*!< keeps track of twiddle status */ }; //! @cond Doxygen_Suppress diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index a7c65380..87a30bac 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -844,6 +844,7 @@ static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) ENTERFUNC; priv->curr->tx_freq = tx_freq; + rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, priv->curr->tx_freq); RETURNFUNC(RIG_OK); } @@ -856,6 +857,7 @@ static int dummy_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) ENTERFUNC; *tx_freq = priv->curr->tx_freq; + rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, priv->curr->tx_freq); RETURNFUNC(RIG_OK); } diff --git a/src/rig.c b/src/rig.c index 40991865..e90ca43a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1661,8 +1661,9 @@ int twiddling(RIG *rig) if (elapsed < rig->state.twiddle_timeout) { - rig_debug(RIG_DEBUG_TRACE, "%s: Twiddle elapsed < 3, elapsed=%d\n", __func__, - elapsed); + rig_debug(RIG_DEBUG_TRACE, "%s: Twiddle elapsed < %d, elapsed=%d\n", __func__, + rig->state.twiddle_timeout, elapsed); + rig->state.twiddle_state = TWIDDLE_ON; // gets turned off in rig_set_freq; RETURNFUNC(1); // would be better as error but other software won't handle it } } @@ -1698,6 +1699,13 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC(-RIG_EIO); } + if (rig->state.twiddle_state == TWIDDLE_ON) + { + // we keep skipping set_freq while the vfo knob is in motion + rig_debug(RIG_DEBUG_VERBOSE, "%s: Twiddle on so skipping this set_freq request one time\n", __func__); + rig->state.twiddle_state = TWIDDLE_OFF; + } + caps = rig->caps; vfo = vfo_fixup(rig, vfo); ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 6 ++++++ rigs/dummy/dummy.c | 2 ++ src/misc.c | 6 +++++- src/rig.c | 12 ++++++++++-- 4 files changed, 23 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |