Fix IC7610 caps structure for new firmware test

pull/1330/head^2
Mike Black W9MDB 2023-07-07 11:47:59 -05:00
rodzic 3bda269494
commit 3cc6b7614c
3 zmienionych plików z 16 dodań i 7 usunięć

Wyświetl plik

@ -345,12 +345,12 @@ int ic7610_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
return retval;
}
const struct rig_caps ic7610_caps =
struct rig_caps ic7610_caps =
{
RIG_MODEL(RIG_MODEL_IC7610),
.model_name = "IC-7610",
.mfg_name = "Icom",
.version = BACKEND_VER ".14",
.version = BACKEND_VER ".15",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -1666,12 +1666,16 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
// Rigs like IC-7600 new firmware has 0x25 and 0x26
// So if this succeeds we'll assume all such rigs are targetable freq & mode
rig_debug(RIG_DEBUG_VERBOSE, "%s: TARGETABLE_FREQ and TARGETABLE_MODE enabled\n", __func__);
if (RIG_IS_IC7600 || RIG_IS_IC7610)
int targetable_vfo_save = rig->caps->targetable_vfo;
if ((RIG_IS_IC7600 || RIG_IS_IC7610) && priv->x25cmdfails <= 0)
{ // the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
rig->caps->targetable_vfo = rig->state.targetable_vfo |= RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE;
subcmd2 = 0;
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) subcmd2 = 1;
if (priv->x25cmdfails < 0)
{ // we'll test this once to support the newer firmware
rig_debug(RIG_DEBUG_VERBOSE, "%s: TARGETABLE_FREQ and TARGETABLE_MODE enabled for testing\n", __func__);
rig->caps->targetable_vfo = rig->state.targetable_vfo |= RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE;
}
}
retval = icom_transaction(rig, cmd2, subcmd2, NULL, 0, freqbuf, &freq_len);
@ -1685,6 +1689,11 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (priv->x25cmdfails < 0)
{
priv->x25cmdfails = 1;
if (RIG_IS_IC7600 || RIG_IS_IC7610)
{
rig->caps->targetable_vfo = targetable_vfo_save;
rig_debug(RIG_DEBUG_VERBOSE, "%s: TARGETABLE_FREQ and TARGETABLE_MODE disabled -- older firmare likely\n", __func__);
}
}
rig_debug(RIG_DEBUG_TRACE,

Wyświetl plik

@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
#define BACKEND_VER "20230627"
#define BACKEND_VER "20230707"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
@ -444,7 +444,7 @@ extern const struct rig_caps ic756pro2_caps;
extern const struct rig_caps ic756pro3_caps;
extern const struct rig_caps ic751_caps;
extern struct rig_caps ic7600_caps; // need to modify targetable_vfo depending on response to 0x25 cmd
extern const struct rig_caps ic7610_caps;
extern struct rig_caps ic7610_caps;
extern const struct rig_caps ic761_caps;
extern const struct rig_caps ic765_caps;
extern const struct rig_caps ic7700_caps;