kopia lustrzana https://github.com/Hamlib/Hamlib
Avoid newcat BS command when VFO freq is not changing
rodzic
a8d841182b
commit
ebeb23e49d
|
@ -816,12 +816,24 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
|
|
||||||
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
|
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
|
||||||
{
|
{
|
||||||
|
if (rig->state.cache.freqMainA == 0)
|
||||||
|
{
|
||||||
|
freq_t freqtmp;
|
||||||
|
err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp);
|
||||||
|
if (err != RIG_OK) RETURNFUNC(err);
|
||||||
|
}
|
||||||
changing = newcat_band_index(freq) != newcat_band_index(
|
changing = newcat_band_index(freq) != newcat_band_index(
|
||||||
rig->state.cache.freqMainA);
|
rig->state.cache.freqMainA);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing);
|
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (rig->state.cache.freqMainB == 0)
|
||||||
|
{
|
||||||
|
freq_t freqtmp;
|
||||||
|
err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp);
|
||||||
|
if (err != RIG_OK) RETURNFUNC(err);
|
||||||
|
}
|
||||||
changing = newcat_band_index(freq) != newcat_band_index(
|
changing = newcat_band_index(freq) != newcat_band_index(
|
||||||
rig->state.cache.freqMainB);
|
rig->state.cache.freqMainB);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing);
|
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing);
|
||||||
|
@ -861,6 +873,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
// Also need to do this for the other VFO on some Yaesu rigs
|
// Also need to do this for the other VFO on some Yaesu rigs
|
||||||
// is redundant for rigs where band stack includes both vfos
|
// is redundant for rigs where band stack includes both vfos
|
||||||
vfo_t vfotmp;
|
vfo_t vfotmp;
|
||||||
|
freq_t freqtmp;
|
||||||
err = rig_get_vfo(rig, &vfotmp);
|
err = rig_get_vfo(rig, &vfotmp);
|
||||||
|
|
||||||
if (err != RIG_OK) { return err; }
|
if (err != RIG_OK) { return err; }
|
||||||
|
@ -874,9 +887,16 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A);
|
err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (err != RIG_OK) { return err; }
|
||||||
|
|
||||||
|
rig_get_freq(rig, RIG_VFO_CURR, &freqtmp);
|
||||||
|
|
||||||
if (err != RIG_OK) { return err; }
|
if (err != RIG_OK) { return err; }
|
||||||
|
|
||||||
|
// we'll ignore UHF/VHF frequencies -- need to see the behavior
|
||||||
|
if (newcat_band_index(freqtmp) != newcat_band_index(freq) && freq < 100e6)
|
||||||
|
{
|
||||||
|
|
||||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c",
|
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c",
|
||||||
newcat_band_index(freq), cat_term);
|
newcat_band_index(freq), cat_term);
|
||||||
|
|
||||||
|
@ -886,6 +906,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||||
__func__,
|
__func__,
|
||||||
rigerror(err));
|
rigerror(err));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// switch back to the starting vfo
|
// switch back to the starting vfo
|
||||||
if (rig->state.vfo_list & RIG_VFO_MAIN)
|
if (rig->state.vfo_list & RIG_VFO_MAIN)
|
||||||
|
@ -9289,6 +9310,7 @@ int newcat_get_cmd(RIG *rig)
|
||||||
int is_read_cmd = 0;
|
int is_read_cmd = 0;
|
||||||
|
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
|
|
||||||
// try to cache rapid repeats of the IF command
|
// try to cache rapid repeats of the IF command
|
||||||
// this is for WSJT-X/JTDX sequence of v/f/m/t
|
// this is for WSJT-X/JTDX sequence of v/f/m/t
|
||||||
// should allow rapid repeat of any call using the IF; cmd
|
// should allow rapid repeat of any call using the IF; cmd
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
typedef char ncboolean;
|
typedef char ncboolean;
|
||||||
|
|
||||||
/* shared function version */
|
/* shared function version */
|
||||||
#define NEWCAT_VER "20210116"
|
#define NEWCAT_VER "20210117"
|
||||||
|
|
||||||
/* Hopefully large enough for future use, 128 chars plus '\0' */
|
/* Hopefully large enough for future use, 128 chars plus '\0' */
|
||||||
#define NEWCAT_DATA_LEN 129
|
#define NEWCAT_DATA_LEN 129
|
||||||
|
|
Ładowanie…
Reference in New Issue