try to fix ecoder buttons

smart-pointers
Phil Taylor 2023-02-07 20:51:20 +00:00
rodzic 72e8bc6fa6
commit 4fc37290e5
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -475,7 +475,7 @@ void usbController::runTimer()
lastData = data;
}
}
else if (usbDevice == eCoderPlus && data.length() == 16 && data[0]==0xff) {
else if (usbDevice == eCoderPlus && data.length() >= 0x0f) {
/* Button matrix:
0100000000000000 = button14
0010000000000000 = button13
@ -492,7 +492,7 @@ void usbController::runTimer()
0000000000000100 = button2
0000000000000010 = button1
*/
quint16 tempButtons = (data[2] << 8) | (data[1] & 0xff);
quint16 tempButtons = (data[1] << 8) | (data[0] & 0xff);
if (buttons != tempButtons)
{