kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'ic910-set-freq' of git://git.code.sf.net/u/bsomervi/hamlib
Fix a logic error in band detection during IC-910 set frequency.libusb-1-0
commit
1f8f4510dd
11
icom/ic910.c
11
icom/ic910.c
|
@ -138,11 +138,13 @@ static int ic910_set_freq(RIG* rig, vfo_t vfo, freq_t freq)
|
||||||
freq_t otherfreq;
|
freq_t otherfreq;
|
||||||
freq_t oldfreq;
|
freq_t oldfreq;
|
||||||
|
|
||||||
if (vfo==RIG_VFO_CURR) {
|
retval=icom_get_freq(rig, vfo, &oldfreq);
|
||||||
/* try to detect active subband */
|
|
||||||
retval=icom_get_freq(rig, RIG_VFO_CURR, &oldfreq);
|
|
||||||
if (retval!=RIG_OK) return retval;
|
if (retval!=RIG_OK) return retval;
|
||||||
|
|
||||||
|
if (!compareFrequencies(rig, freq, oldfreq)) {
|
||||||
|
/* we are on the wrong band */
|
||||||
|
if (vfo==RIG_VFO_CURR) {
|
||||||
|
/* try to detect active subband */
|
||||||
icom_set_vfo(rig, RIG_VFO_SUB);
|
icom_set_vfo(rig, RIG_VFO_SUB);
|
||||||
|
|
||||||
retval=icom_get_freq(rig, RIG_VFO_CURR, &otherfreq);
|
retval=icom_get_freq(rig, RIG_VFO_CURR, &otherfreq);
|
||||||
|
@ -169,10 +171,11 @@ static int ic910_set_freq(RIG* rig, vfo_t vfo, freq_t freq)
|
||||||
if (retval!=RIG_OK) return retval;
|
if (retval!=RIG_OK) return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compareFrequencies(rig, freq, otherfreq) == 0)
|
if (compareFrequencies(rig, freq, otherfreq))
|
||||||
icom_swap_bands(rig);
|
icom_swap_bands(rig);
|
||||||
|
|
||||||
icom_set_vfo(rig, vfo);
|
icom_set_vfo(rig, vfo);
|
||||||
|
}
|
||||||
return icom_set_freq(rig, RIG_VFO_CURR, freq);
|
return icom_set_freq(rig, RIG_VFO_CURR, freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue