Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate uotghs_host.c #66
Conversation
If you try to read longer messages (>256 bytes) from USB device from host side, the buffer rolls over overwriting the buffer. For DUE/SAM can handle pipes with 1024 bytes, a uint16_t should be used.
@@ -360,7 +360,7 @@ void UHD_Pipe_Free(uint32_t ul_pipe) | |||
uint32_t UHD_Pipe_Read(uint32_t ul_pipe, uint32_t ul_size, uint8_t* data) | |||
{ | |||
uint8_t *ptr_ep_data = 0; | |||
uint8_t nb_byte_received = 0; | |||
uint16_t nb_byte_received = 0; //otherwise roll over when reading pipe >256 Bytes |
per1234
Apr 23, 2019
Contributor
I feel the comment on this line will be confusing when read without the context of the other information in this pull request. If the comment is to be there, I think it could be better worded.
If you try to read longer messages (>256 bytes) from USB device from host side, the buffer rolls over overwriting the buffer.
For DUE/SAM can handle pipes with 1024 bytes, a uint16_t should be used here.
I needed this for example to be able to read 512 bytes of data from a USB-Midi device.