kopia lustrzana https://github.com/Hamlib/Hamlib
Fix TX/RX VFO for get/set freq
rodzic
1d0373385b
commit
8bab7d6e46
21
icom/icom.c
21
icom/icom.c
|
@ -629,6 +629,22 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
int subcmd = -1;
|
int subcmd = -1;
|
||||||
unsigned char data;
|
unsigned char data;
|
||||||
int datalen = 0;
|
int datalen = 0;
|
||||||
|
|
||||||
|
// Pick the appropriate VFO when VFO_TX is requested
|
||||||
|
if (vfo == RIG_VFO_TX) {
|
||||||
|
if (priv->split_on) {
|
||||||
|
vfo = rig->state.vfo_list & RIG_VFO_B ? RIG_VFO_B : RIG_VFO_SUB;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
vfo = rig->state.vfo_list & RIG_VFO_B ? RIG_VFO_A : RIG_VFO_MAIN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Pick the appropriate VFO when VFO_RX is requested
|
||||||
|
if (vfo == RIG_VFO_RX) {
|
||||||
|
vfo = rig->state.vfo_list & RIG_VFO_B ? RIG_VFO_A : RIG_VFO_MAIN;
|
||||||
|
}
|
||||||
|
rig_debug(RIG_DEBUG_VERBOSE,"icom_get_freq: using vfo=%s\n",rig_strvfo(vfo));
|
||||||
|
|
||||||
switch(vfo) {
|
switch(vfo) {
|
||||||
case RIG_VFO_MAIN:
|
case RIG_VFO_MAIN:
|
||||||
cmd = C_SET_VFO;
|
cmd = C_SET_VFO;
|
||||||
|
@ -642,6 +658,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
data = 1;
|
data = 1;
|
||||||
datalen = 1;
|
datalen = 1;
|
||||||
break;
|
break;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
retval = icom_transaction (rig, cmd, subcmd, datalen==0?NULL:&data, datalen, freqbuf, &freq_len);
|
retval = icom_transaction (rig, cmd, subcmd, datalen==0?NULL:&data, datalen, freqbuf, &freq_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
|
@ -1185,12 +1202,15 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
||||||
if (vfo == RIG_VFO_CURR)
|
if (vfo == RIG_VFO_CURR)
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
|
||||||
|
struct rig_state *rs = &rig->state;
|
||||||
|
struct icom_priv_data *priv = (struct icom_priv_data*)rs->priv;
|
||||||
|
|
||||||
switch(vfo) {
|
switch(vfo) {
|
||||||
case RIG_VFO_A: icvfo = S_VFOA; break;
|
case RIG_VFO_A: icvfo = S_VFOA; break;
|
||||||
case RIG_VFO_B: icvfo = S_VFOB; break;
|
case RIG_VFO_B: icvfo = S_VFOB; break;
|
||||||
case RIG_VFO_MAIN: icvfo = S_MAIN; break;
|
case RIG_VFO_MAIN: icvfo = S_MAIN; break;
|
||||||
case RIG_VFO_SUB: icvfo = S_SUB; break;
|
case RIG_VFO_SUB: icvfo = S_SUB; break;
|
||||||
|
case RIG_VFO_TX: icvfo = priv->split_on ? S_VFOB : S_VFOA; break;
|
||||||
case RIG_VFO_VFO:
|
case RIG_VFO_VFO:
|
||||||
retval = icom_transaction (rig, C_SET_VFO, -1, NULL, 0,
|
retval = icom_transaction (rig, C_SET_VFO, -1, NULL, 0,
|
||||||
ackbuf, &ack_len);
|
ackbuf, &ack_len);
|
||||||
|
@ -1213,6 +1233,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
||||||
return -RIG_ERJCTED;
|
return -RIG_ERJCTED;
|
||||||
}
|
}
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rig_debug(RIG_DEBUG_ERR,"icom: Unsupported VFO %d\n", vfo);
|
rig_debug(RIG_DEBUG_ERR,"icom: Unsupported VFO %d\n", vfo);
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BACKEND_VER "0.9"
|
#define BACKEND_VER "0.10"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* defines used by comp_cal_str in rig.c
|
* defines used by comp_cal_str in rig.c
|
||||||
|
|
Ładowanie…
Reference in New Issue