Hi!
I am testing the CDC Device Demo. USBBUFFERSIZE is set to 256 and this value is passed to my receive buffer which is a tUSBBuffer.
Now it turns out that although the buffer size is 256, USBBufferSpaceAvailable() returns only 255 for an empty buffer and only 255 bytes can be read at once when a call to USBBufferRead() is performed. I don't see this behavior documented anywhere in StellarisWare, to the contrary in the USB lib guide says:
"This function reads up to ulLength bytes of data received from the USB host into the supplied application buffer."
My questions are: Why does the buffered read read one byte less than the buffer size and is it efficient to set the buffer size to 256 as done in the demo when the USB packets are 64 bytes each? Or should I set the buffer to 257 to use it more efficiently?
Thanks,
Anguel