Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix zero length packet handling (#73)
This fixes zero length packet handling. See the following example that requests 128 bytes: ``` SETUP(8) IN(64) IN(64) STATUS(0) ``` The current code erroneously assumes that there are no more IN packets after the first two 64-byte packets. However, what happens with the following: ``` SETUP(8) IN(64) IN(64) IN(64) <--- current code assumes this will be, and expects a STATUS packet STATUS(0) ``` Currently, the third IN(64) above will result in a coding error because the code is expecting the STATUS packet, not another IN packet. The "controller" must allow for more packets than expected, returning a short packet detect on the third IN(64) packet shown above, actually returning zero bytes, hence the Short Packet Detect. This patch was tested on WinXP, Win7, and Win10.
- Loading branch information