Speed up rig_band_changed actions for FT991 and perhaps others

Putting the AC001; command immediately after FA freq change make the band change end state occur immediately
pull/1481/head
Mike Black W9MDB 2024-01-15 07:28:22 -06:00
rodzic d6689145a0
commit 4d568c782e
1 zmienionych plików z 27 dodań i 15 usunięć

Wyświetl plik

@ -1977,6 +1977,7 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
vfo_t vfo_save;
static int last_band = -1;
int curr_band;
int band_changing = 0;
if (CHECK_RIG_ARG(rig))
{
@ -1990,7 +1991,8 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: band changing to %s\n", __func__,
rig_get_band_str(rig, curr_band, 0));
rig_band_changed(rig, curr_band);
band_changing = 1;
//rig_band_changed(rig, curr_band);
last_band = curr_band;
}
@ -2117,8 +2119,13 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
do
{
HAMLIB_TRACE;
retcode = caps->set_freq(rig, vfo, freq);
if (band_changing)
{
rig_band_changed(rig, curr_band);
}
// disabling the freq check as of 2023-06-02
// seems unnecessary and slows down rigs unnecessarily
tfreq = freq;
@ -2207,6 +2214,9 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
HAMLIB_TRACE;
if (band_changing) { rig_band_changed(rig, curr_band); }
retcode = caps->set_freq(rig, vfo, freq);
}
@ -4521,10 +4531,8 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
{
tx_vfo = rig->state.tx_vfo;
}
else
{
tx_vfo = vfo_fixup(rig, vfo, rig->state.cache.split);
}
tx_vfo = vfo_fixup(rig, tx_vfo, rig->state.cache.split);
rig_get_freq(rig, tx_vfo, &tfreq);
@ -8652,16 +8660,20 @@ int morse_data_handler_set_keyspd(RIG *rig, int keyspd)
*/
HAMLIB_EXPORT(void *) rig_data_pointer(RIG *rig, rig_ptrx_t idx)
{
switch(idx)
switch (idx)
{
case RIG_PTRX_RIGPORT:
return RIGPORT(rig);
case RIG_PTRX_PTTPORT:
return PTTPORT(rig);
case RIG_PTRX_DCDPORT:
return DCDPORT(rig);
case RIG_PTRX_CACHE:
return CACHE(rig);
default:
rig_debug(RIG_DEBUG_ERR, "%s: Invalid data index=%d\n", __func__, idx);
return NULL;