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
Nate Bargmann 2016-01-20 21:26:56 -06:00
commit 1f8f4510dd
1 zmienionych plików z 36 dodań i 33 usunięć

Wyświetl plik

@ -138,11 +138,13 @@ static int ic910_set_freq(RIG* rig, vfo_t vfo, freq_t freq)
freq_t otherfreq;
freq_t oldfreq;
if (vfo==RIG_VFO_CURR) {
/* try to detect active subband */
retval=icom_get_freq(rig, RIG_VFO_CURR, &oldfreq);
retval=icom_get_freq(rig, vfo, &oldfreq);
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);
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 (compareFrequencies(rig, freq, otherfreq) == 0)
if (compareFrequencies(rig, freq, otherfreq))
icom_swap_bands(rig);
icom_set_vfo(rig, vfo);
}
return icom_set_freq(rig, RIG_VFO_CURR, freq);
}