When vfo twiddling is being done set_freq calls will be skipped

https://github.com/Hamlib/Hamlib/issues/664
pull/668/head
Mike Black W9MDB 2021-04-15 11:47:58 -05:00
rodzic 9cb7c7dcdf
commit 7d79b59bd7
3 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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);