mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-22 19:07:22 +00:00
Add newer Set 2 RIT command to appropriate kenwood rigs
This commit is contained in:
parent
3cb79b3bca
commit
d95bcccc94
@ -744,6 +744,18 @@ int kenwood_open(RIG *rig)
|
||||
}
|
||||
}
|
||||
|
||||
if (RIG_IS_TS2000
|
||||
|| RIG_IS_TS480
|
||||
|| RIG_IS_TS590S
|
||||
|| RIG_IS_TS590SG
|
||||
|| RIG_IS_TS890S
|
||||
|| RIG_IS_TS990S)
|
||||
{
|
||||
// rig has Set 2 RIT/XIT function
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: rig has_rit2\n", __func__);
|
||||
priv->has_rit2 = 1;
|
||||
}
|
||||
|
||||
if (RIG_IS_TS590S)
|
||||
{
|
||||
/* we need the firmware version for these rigs to deal with f/w defects */
|
||||
@ -1652,9 +1664,11 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
int retval, i;
|
||||
shortfreq_t curr_rit;
|
||||
int diff;
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld\n", __func__,
|
||||
rig_strvfo(vfo), rit);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld, has_rit2=%d\n",
|
||||
__func__,
|
||||
rig_strvfo(vfo), rit, priv->has_rit2);
|
||||
|
||||
retval = kenwood_get_rit(rig, vfo, &curr_rit);
|
||||
|
||||
@ -1663,13 +1677,14 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
return retval;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s get_rit=%ld\n", __func__, curr_rit);
|
||||
|
||||
if (rit == 0)
|
||||
if (priv->has_rit2) // if backend shows it has the Set 2 command
|
||||
{
|
||||
return kenwood_transaction(rig, "RC", NULL, 0);
|
||||
char cmd[10];
|
||||
snprintf(cmd, sizeof(cmd) - 1, "R%c%05d", rit > 0 ? 'U' : 'D', (int)rit);
|
||||
retval = kenwood_transaction(rig, cmd, NULL, 0);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
retval = kenwood_transaction(rig, "RC", NULL, 0);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
@ -1677,6 +1692,8 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (rit == 0) { return RIG_OK; } // we're done here
|
||||
|
||||
snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D');
|
||||
|
||||
diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest
|
||||
@ -1686,6 +1703,7 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
retval = kenwood_transaction(rig, buf, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ extern const struct confparams kenwood_cfg_params[];
|
||||
#define RIG_IS_TS2000 (rig->caps->rig_model == RIG_MODEL_TS2000)
|
||||
#define RIG_IS_TS50 (rig->caps->rig_model == RIG_MODEL_TS50)
|
||||
#define RIG_IS_TS450S (rig->caps->rig_model == RIG_MODEL_TS450S)
|
||||
#define RIG_IS_TS450S (rig->caps->rig_model == RIG_MODEL_TS450S)
|
||||
#define RIG_IS_TS480 (rig->caps->rig_model == RIG_MODEL_TS480)
|
||||
#define RIG_IS_TS590S (rig->caps->rig_model == RIG_MODEL_TS590S)
|
||||
#define RIG_IS_TS590SG (rig->caps->rig_model == RIG_MODEL_TS590SG)
|
||||
#define RIG_IS_TS690S (rig->caps->rig_model == RIG_MODEL_TS690S)
|
||||
@ -120,13 +120,10 @@ struct kenwood_priv_data
|
||||
int is_emulation; /* flag for TS-2000 emulations */
|
||||
void *data; /* model specific data */
|
||||
rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */
|
||||
// Boolean flags true when model is in use
|
||||
int is_590s;
|
||||
int is_590sg;
|
||||
int is_950;
|
||||
struct timespec cache_start;
|
||||
char last_if_response[KENWOOD_MAX_BUF_LEN];
|
||||
int poweron; /* to avoid powering on more than once */
|
||||
int has_rit2; /* rig has set 2 rit command */
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user