Read all available data from OUT endpoint on LPC17xx's USB.
Read all available data from OUT endpoint on LPC17xx's USB.

This fixes reading multi-packed commands over USB from the host. I
misread the documentation - there is actually an internal 512 byte
buffer in the USB stack that you are reading from when you call
Endpoint_Read_8, so it may contain more than a single packet (64 bytes).
There's an Endpoint_BytesInEndpoint() function to check exactly how many
bytes are available, and since some could be added while we are in the
middle of reading, I do it in a while().

Lastly, the Endpoint_ClearOUT was actually dumping valid data - looking
into the library further, it's intended for another API and not the
Endpoint_Read_8.

mgiannikouris/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware