atc1441 / CH559sdccUSBHost

USB host to Arduino Interface with the Cheap CH559 uC
GNU General Public License v3.0
227 stars 54 forks source link

Not forwarding the first packet received after host initializes the device #12

Closed reardomi77 closed 3 years ago

reardomi77 commented 3 years ago

After the CH559 host connects to a usb keyboard, a descriptor is received and forwarded to the serial port. However, after pressing the first key on a keyboard, not every packet gets sent to the serial port (get 3 out of 4, the missing packet happens to contain the byte of the key pressed). Subsequent key presses come through fine, it only happens once after the device first connects.

UPDATE: Setting variable s = ERR_SUCCESS when s = 0x23 seems to be functioning workaround. This change needs to be applied to line 547 in the USBHost.c file

nockieboy commented 2 years ago

For anyone else finding this same issue, changing line 547 to:

if ( s == ERR_SUCCESS || s == 35 )

works just fine as a solution.