Jochen Hoenicke 94f92d54d6 stmfx07: usb: keep better track of rxbcnt
When reading a portion of the packet that is not divisible by 4 and
not equal to rxbcnt the count could get off, since 4 bytes are read
from the fifo in the last step but rxbcnt was only updated by the
number of bytes the caller requested.

We fix this by always subtracting four bytes (the number of bytes
read from the fifo) when we read a word from the fifo.  Care has
to be taken in the last step so that rxbcnt doesn't underflow (it
is an unsigned number).

Note that reading in several small chunks not divisible by 4 doesn't
work as the extra bytes read in the last step are always discarded.
2017-03-30 21:48:07 +00:00
..
2016-11-21 17:27:43 +00:00
2015-10-14 20:48:26 +00:00