FTDI: Fix baudrate setting on multiport devices

Correction of https://github.com/felHR85/UsbSerial/pull/274
pull/333/head
alex 2021-06-14 14:26:35 -07:00 zatwierdzone przez green-green-avk
rodzic f537d13ede
commit f0dda6635c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7F6CFE0BE62FE94B
1 zmienionych plików z 3 dodań i 6 usunięć

Wyświetl plik

@ -883,12 +883,9 @@ public class FTDISerialDevice extends UsbSerialDevice
divisor |= (encodedFraction[frac] << 14) | fastClk;
ret[0] = (short) divisor; //loBits
ret[1] = (short) (divisor >> 16); //hiBits
if(hIndex) {
ret[1] <<= 8;
}
ret[1] = hIndex ?
(short) ((divisor >> 8) & 0xFF00 | (mInterface.getId() + 1))
: (short) (divisor >> 16); //hiBits
return ret;
}