plustek-usbhw.c: Add 1ms sleep before writing to register 0x59

Works around discovery problem for CanoScan N650U, fixes #137.
merge-requests/540/head
Zdenek Dohnal 2020-10-09 08:55:41 +02:00
rodzic 9ac6ee6cd6
commit 6af85ec669
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -1451,6 +1451,14 @@ usb_ResetRegisters( Plustek_Device *dev )
* CanoScan devices to work properly after power-up
*/
sanei_lm983x_write_byte( dev->fd, 0x5b, regs[0x5b] );
/* At least CanoScan N650U can have a problem with writing
* to register 0x59 due XHCI USB controller is too
* fast for him. Simulate EHCI USB controller's
* behavior here - wait 1ms.
*/
usleep(1000);
sanei_lm983x_write_byte( dev->fd, 0x59, regs[0x59] );
sanei_lm983x_write_byte( dev->fd, 0x5a, regs[0x5a] );
} else {