Page 1 of 1

usb_control_msg length

Posted: Thu Feb 22, 2007 10:05 am
by ahulap
Hello!
I'm developing AVR-USB device on tiny2313 and want to implement usbFunctionWrite and usbFunctionRead. In control message there is a 2-byte transfer length (bytes 6 and 7), but this software driver can handle maximum 254 bytes.
Can i ignore length high byte and use byte-size counter instead of word-size? (this will save around 30 bytes of code, what is great for 2k device). Is there needed any checks for transfer bigger than 254 bytes or driver will reject such transfers at low level? My PC software will not send more than 254 bytes in one transfer, but to be sure...

Posted: Wed Mar 07, 2007 2:02 pm
by christian
Yes, you can safely ignore the high byte. The driver does the same thing in order to save some bytes of code.

Posted: Wed Mar 07, 2007 4:17 pm
by ahulap
Thank you!