Status: Accepted
Owner: [email protected]
Labels: Type-Enhancement Priority-Medium
New issue 177 by [email protected]: USB for loop not needed in
usb_drv_core.jal
http://code.google.com/p/jallib/issues/detail?id=177
Prevous discussion at:
http://groups.google.com/group/jallib/browse_thread/thread/e6c730dbaa2a31f8/3b4bf0227b3231ef?lnk=gst&q=msd#3b4bf0227b3231ef
I noticed in usb_drv_core.jal, procedure usb_send_data(). There is a
for loop that appears to be useless.
for byte_cnt using idx loop
usb_delivery_buffer[idx] = data[idx]
if USB_DEBUG > 0 then
print_byte_hex(serial_data, usb_delivery_buffer[idx)
end if
end loop
I noticed that usb_delivery_buffer is only defined as 8 bytes in
usb_defs.jal, but idx will be the size of data to be transferred which is
usually larger. For example, MSD usually sends 64 bytes.
It appears that this array copy is also done with _usb_copy_array_to_ram()
later on in the same procedure.
If I remove this for loop completely, MSD still works as expected.
More testing needs to be done with other USB libraries to be sure the for
loop can be removed.
usb_send_data() is a useful procedure, however it may be better to use the
usb_delivery_buffer[] directly instead of putting data into your own array
then using usb_send_data() which copies data from array to array.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.