Changes for FT991 RIT/XIT

pull/361/head
Mike Goodey 2020-08-28 18:16:17 +01:00
rodzic 331d9773b0
commit 8ba082c662
2 zmienionych plików z 67 dodań i 14 usunięć

Wyświetl plik

@ -65,6 +65,7 @@
#define FT991_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ #define FT991_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
RIG_FUNC_RIT|RIG_FUNC_XIT|\
RIG_FUNC_TUNER) RIG_FUNC_TUNER)
#define FT991_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ #define FT991_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\

Wyświetl plik

@ -97,7 +97,8 @@ typedef struct _yaesu_newcat_commands
const cal_table_float_t yaesu_default_swr_cal = const cal_table_float_t yaesu_default_swr_cal =
{ {
4, 4,
{ // first cut at generic Yaesu table, need more points probably {
// first cut at generic Yaesu table, need more points probably
// based on testing by Adam M7OTP on FT-991 // based on testing by Adam M7OTP on FT-991
{12, 1.0f}, {12, 1.0f},
{39, 1.35f}, {39, 1.35f},
@ -1158,9 +1159,9 @@ int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
*ptt = RIG_PTT_OFF; *ptt = RIG_PTT_OFF;
break; break;
case '1' : /* Just because,    what the CAT Manual Shows */ case '1' : /* Just because, what the CAT Manual Shows */
case '2' : /* FT-950 Radio:    Mic, Dataport, CW "TX ON" */ case '2' : /* FT-950 Radio: Mic, Dataport, CW "TX ON" */
case '3' : /* FT-950 CAT port: Radio in "TX ON" mode     [Not what the CAT Manual Shows] */ case '3' : /* FT-950 CAT port: Radio in "TX ON" mode [Not what the CAT Manual Shows] */
*ptt = RIG_PTT_ON; *ptt = RIG_PTT_ON;
break; break;
@ -1575,9 +1576,9 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
rit = - rig->caps->max_rit; /* - */ rit = - rig->caps->max_rit; /* - */
} }
if (rit == 0) if (rit == 0) // don't turn it off just because it is zero
{ {
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%cRT0%c", cat_term, snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%c",
cat_term); cat_term);
} }
else if (rit < 0) else if (rit < 0)
@ -1599,7 +1600,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
{ {
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
char *retval; char *retval;
char rit_on; //char rit_on;
int err; int err;
int offset = 0; int offset = 0;
@ -1643,11 +1644,12 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
} }
retval = priv->ret_data + offset; retval = priv->ret_data + offset;
rit_on = retval[5]; //rit_on = retval[5];
retval[5] = '\0'; retval[5] = '\0';
if (rit_on == '1') //if (rit_on == '1')
{ {
// return the current offset even if turned off
*rit = (shortfreq_t) atoi(retval); *rit = (shortfreq_t) atoi(retval);
} }
@ -1675,7 +1677,8 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
if (xit == 0) if (xit == 0)
{ {
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%cXT0%c", cat_term, // don't turn it off just because the offset is zero
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%c",
cat_term); cat_term);
} }
else if (xit < 0) else if (xit < 0)
@ -1697,7 +1700,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
{ {
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
char *retval; char *retval;
char xit_on; //char xit_on;
int err; int err;
int offset = 0; int offset = 0;
@ -1741,11 +1744,12 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
} }
retval = priv->ret_data + offset; retval = priv->ret_data + offset;
xit_on = retval[6]; //xit_on = retval[6];
retval[5] = '\0'; retval[5] = '\0';
if (xit_on == '1') //if (xit_on == '1')
{ {
// return the offset even when turned off
*xit = (shortfreq_t) atoi(retval); *xit = (shortfreq_t) atoi(retval);
} }
@ -3371,7 +3375,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{ {
val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->swr_cal); val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->swr_cal);
} }
break; break;
case RIG_LEVEL_AF: case RIG_LEVEL_AF:
case RIG_LEVEL_MICGAIN: case RIG_LEVEL_MICGAIN:
case RIG_LEVEL_RF: case RIG_LEVEL_RF:
@ -3687,6 +3693,26 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
cat_term); cat_term);
break; break;
case RIG_FUNC_RIT:
if (!newcat_valid_command(rig, "RT"))
{
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RT%d%c", status ? 1 : 0,
cat_term);
break;
case RIG_FUNC_XIT:
if (!newcat_valid_command(rig, "XT"))
{
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%d9%c", status ? 1 : 0,
cat_term);
break;
default: default:
return -RIG_EINVAL; return -RIG_EINVAL;
} }
@ -3831,6 +3857,24 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC%c", cat_term); snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC%c", cat_term);
break; break;
case RIG_FUNC_RIT:
if (!newcat_valid_command(rig, "RT"))
{
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RT%c", cat_term);
break;
case RIG_FUNC_XIT:
if (!newcat_valid_command(rig, "XT"))
{
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%c", cat_term);
break;
default: default:
return -RIG_EINVAL; return -RIG_EINVAL;
} }
@ -3876,6 +3920,14 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
*status = (retfunc[2] == '1') ? 1 : 0; *status = (retfunc[2] == '1') ? 1 : 0;
break; break;
case RIG_FUNC_RIT:
*status = (retfunc[0] == '1') ? 1 : 0;
break;
case RIG_FUNC_XIT:
*status = (retfunc[0] == '1') ? 1 : 0;
break;
default: default:
return -RIG_EINVAL; return -RIG_EINVAL;
} }