kopia lustrzana https://github.com/Hamlib/Hamlib
rodzic
b1d85e5aa1
commit
4a1fa678ea
|
@ -65,12 +65,12 @@ int rig_set_cache_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||||
|
|
||||||
if (vfo == rig->state.current_vfo)
|
if (vfo == rig->state.current_vfo)
|
||||||
{
|
{
|
||||||
rig->state.cache.modeCurr = mode;
|
cachep->modeCurr = mode;
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
{
|
{
|
||||||
rig->state.cache.widthCurr = width;
|
cachep->widthCurr = width;
|
||||||
}
|
}
|
||||||
elapsed_ms(&rig->state.cache.time_modeCurr, HAMLIB_ELAPSED_SET);
|
elapsed_ms(&cachep->time_modeCurr, HAMLIB_ELAPSED_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (vfo)
|
switch (vfo)
|
||||||
|
|
45
src/rig.c
45
src/rig.c
|
@ -4527,8 +4527,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||||
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
||||||
tx_vfo = rs->tx_vfo;
|
tx_vfo = rs->tx_vfo;
|
||||||
|
|
||||||
if (rs->cache.split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE
|
if (cachep->split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR)
|
||||||
|| tx_vfo == RIG_VFO_CURR)
|
|
||||||
{
|
{
|
||||||
// Turn split on if not enabled already
|
// Turn split on if not enabled already
|
||||||
retcode = rig_set_split_vfo(rig, rs->current_vfo, RIG_SPLIT_ON, vfo_fixup(rig,
|
retcode = rig_set_split_vfo(rig, rs->current_vfo, RIG_SPLIT_ON, vfo_fixup(rig,
|
||||||
|
@ -4599,7 +4598,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||||
|
|
||||||
// Assisted mode: Swap VFOs and try either set_split_freq or set_freq
|
// Assisted mode: Swap VFOs and try either set_split_freq or set_freq
|
||||||
curr_vfo = rs->current_vfo;
|
curr_vfo = rs->current_vfo;
|
||||||
vfo = vfo_fixup(rig, vfo, rs->cache.split);
|
vfo = vfo_fixup(rig, vfo, cachep->split);
|
||||||
|
|
||||||
if (caps->set_vfo)
|
if (caps->set_vfo)
|
||||||
{
|
{
|
||||||
|
@ -4692,6 +4691,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||||
{
|
{
|
||||||
const struct rig_caps *caps;
|
const struct rig_caps *caps;
|
||||||
const struct rig_state *rs;
|
const struct rig_state *rs;
|
||||||
|
struct rig_cache *cachep = CACHE(rig);
|
||||||
int retcode = -RIG_EPROTO, rc2;
|
int retcode = -RIG_EPROTO, rc2;
|
||||||
vfo_t tx_vfo;
|
vfo_t tx_vfo;
|
||||||
|
|
||||||
|
@ -4716,8 +4716,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||||
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
||||||
tx_vfo = rs->tx_vfo;
|
tx_vfo = rs->tx_vfo;
|
||||||
|
|
||||||
if (rs->cache.split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE
|
if (cachep->split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR)
|
||||||
|| tx_vfo == RIG_VFO_CURR)
|
|
||||||
{
|
{
|
||||||
// Split frequency not available if split is off
|
// Split frequency not available if split is off
|
||||||
*tx_freq = 0;
|
*tx_freq = 0;
|
||||||
|
@ -4756,7 +4755,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assisted mode: Swap VFOs and try either get_split_freq or get_freq
|
// Assisted mode: Swap VFOs and try either get_split_freq or get_freq
|
||||||
vfo = vfo_fixup(rig, vfo, rs->cache.split);
|
vfo = vfo_fixup(rig, vfo, cachep->split);
|
||||||
|
|
||||||
if (caps->set_vfo)
|
if (caps->set_vfo)
|
||||||
{
|
{
|
||||||
|
@ -4893,8 +4892,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
||||||
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
||||||
tx_vfo = rs->tx_vfo;
|
tx_vfo = rs->tx_vfo;
|
||||||
|
|
||||||
if (rs->cache.split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE
|
if (cachep->split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR)
|
||||||
|| tx_vfo == RIG_VFO_CURR)
|
|
||||||
{
|
{
|
||||||
// Turn split on if not enabled already
|
// Turn split on if not enabled already
|
||||||
retcode = rig_set_split_vfo(rig, rs->current_vfo, RIG_SPLIT_ON, vfo_fixup(rig,
|
retcode = rig_set_split_vfo(rig, rs->current_vfo, RIG_SPLIT_ON, vfo_fixup(rig,
|
||||||
|
@ -5105,6 +5103,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||||
{
|
{
|
||||||
const struct rig_caps *caps;
|
const struct rig_caps *caps;
|
||||||
const struct rig_state *rs;
|
const struct rig_state *rs;
|
||||||
|
struct rig_cache *cachep = CACHE(rig);
|
||||||
int retcode, rc2;
|
int retcode, rc2;
|
||||||
vfo_t curr_vfo, tx_vfo;
|
vfo_t curr_vfo, tx_vfo;
|
||||||
|
|
||||||
|
@ -5129,8 +5128,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||||
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
||||||
tx_vfo = rs->tx_vfo;
|
tx_vfo = rs->tx_vfo;
|
||||||
|
|
||||||
if (rs->cache.split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE
|
if (cachep->split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR)
|
||||||
|| tx_vfo == RIG_VFO_CURR)
|
|
||||||
{
|
{
|
||||||
// Split mode and filter width are not available if split is off
|
// Split mode and filter width are not available if split is off
|
||||||
*tx_mode = RIG_MODE_NONE;
|
*tx_mode = RIG_MODE_NONE;
|
||||||
|
@ -5289,8 +5287,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig,
|
||||||
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
||||||
tx_vfo = rs->tx_vfo;
|
tx_vfo = rs->tx_vfo;
|
||||||
|
|
||||||
if (rs->cache.split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE
|
if (cachep->split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR)
|
||||||
|| tx_vfo == RIG_VFO_CURR)
|
|
||||||
{
|
{
|
||||||
// Turn split on if not enabled already
|
// Turn split on if not enabled already
|
||||||
retcode = rig_set_split_vfo(rig, rs->current_vfo, RIG_SPLIT_ON, vfo_fixup(rig,
|
retcode = rig_set_split_vfo(rig, rs->current_vfo, RIG_SPLIT_ON, vfo_fixup(rig,
|
||||||
|
@ -5411,6 +5408,7 @@ int HAMLIB_API rig_get_split_freq_mode(RIG *rig,
|
||||||
{
|
{
|
||||||
const struct rig_caps *caps;
|
const struct rig_caps *caps;
|
||||||
const struct rig_state *rs;
|
const struct rig_state *rs;
|
||||||
|
struct rig_cache *cachep = CACHE(rig);
|
||||||
vfo_t tx_vfo;
|
vfo_t tx_vfo;
|
||||||
int retcode;
|
int retcode;
|
||||||
|
|
||||||
|
@ -5435,8 +5433,7 @@ int HAMLIB_API rig_get_split_freq_mode(RIG *rig,
|
||||||
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
// Always use the previously selected TX VFO for split. The targeted VFO will have no effect.
|
||||||
tx_vfo = rs->tx_vfo;
|
tx_vfo = rs->tx_vfo;
|
||||||
|
|
||||||
if (rs->cache.split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE
|
if (cachep->split == RIG_SPLIT_OFF || tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR)
|
||||||
|| tx_vfo == RIG_VFO_CURR)
|
|
||||||
{
|
{
|
||||||
// Split frequency, mode and filter width are not available if split is off
|
// Split frequency, mode and filter width are not available if split is off
|
||||||
*tx_freq = 0;
|
*tx_freq = 0;
|
||||||
|
@ -5634,17 +5631,16 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig,
|
||||||
{
|
{
|
||||||
// Only update cache on success
|
// Only update cache on success
|
||||||
rs->rx_vfo = rs->current_vfo;
|
rs->rx_vfo = rs->current_vfo;
|
||||||
rs->cache.split = split;
|
cachep->split = split;
|
||||||
|
|
||||||
if (split == RIG_SPLIT_OFF)
|
if (split == RIG_SPLIT_OFF)
|
||||||
{
|
{
|
||||||
rs->tx_vfo = rs->current_vfo;
|
rs->tx_vfo = rs->current_vfo;
|
||||||
rs->cache.split_vfo = rs->current_vfo;
|
cachep->split_vfo = rs->current_vfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rs->tx_vfo = tx_vfo;
|
rs->tx_vfo = tx_vfo;
|
||||||
rs->cache.split_vfo = tx_vfo;
|
cachep->split_vfo = tx_vfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5693,28 +5689,27 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig,
|
||||||
if (retcode == RIG_OK)
|
if (retcode == RIG_OK)
|
||||||
{
|
{
|
||||||
// Only update cache on success
|
// Only update cache on success
|
||||||
rs->cache.split = split;
|
cachep->split = split;
|
||||||
|
|
||||||
if (split == RIG_SPLIT_OFF)
|
if (split == RIG_SPLIT_OFF)
|
||||||
{
|
{
|
||||||
if (caps->targetable_vfo & RIG_TARGETABLE_FREQ)
|
if (caps->targetable_vfo & RIG_TARGETABLE_FREQ)
|
||||||
{
|
{
|
||||||
rs->rx_vfo = rx_vfo;
|
rs->rx_vfo = rx_vfo;
|
||||||
rs->tx_vfo = rx_vfo;
|
rs->tx_vfo = rx_vfo;
|
||||||
rs->cache.split_vfo = rx_vfo;
|
cachep->split_vfo = rx_vfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rs->rx_vfo = rs->current_vfo;
|
rs->rx_vfo = rs->current_vfo;
|
||||||
rs->tx_vfo = rs->current_vfo;
|
rs->tx_vfo = rs->current_vfo;
|
||||||
rs->cache.split_vfo = rs->current_vfo;
|
cachep->split_vfo = rs->current_vfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rs->rx_vfo = rx_vfo;
|
rs->rx_vfo = rx_vfo;
|
||||||
rs->tx_vfo = tx_vfo;
|
rs->tx_vfo = tx_vfo;
|
||||||
rs->cache.split_vfo = tx_vfo;
|
cachep->split_vfo = tx_vfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5806,8 +5801,8 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig,
|
||||||
{
|
{
|
||||||
// Only update cache on success
|
// Only update cache on success
|
||||||
rs->tx_vfo = *tx_vfo;
|
rs->tx_vfo = *tx_vfo;
|
||||||
cachep-split = *split;
|
cachep->split = *split;
|
||||||
cachep-split_vfo = *tx_vfo;
|
cachep->split_vfo = *tx_vfo;
|
||||||
elapsed_ms(&cachep->time_split, HAMLIB_ELAPSED_SET);
|
elapsed_ms(&cachep->time_split, HAMLIB_ELAPSED_SET);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): cache.split=%d\n", __func__, __LINE__,
|
rig_debug(RIG_DEBUG_TRACE, "%s(%d): cache.split=%d\n", __func__, __LINE__,
|
||||||
cachep->split);
|
cachep->split);
|
||||||
|
|
Ładowanie…
Reference in New Issue