usb_control_msg length
Posted: Thu Feb 22, 2007 10:05 am
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...
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...