Re: [tuxdroid-user] usb_read_TuxDroid() correctness
Status: Beta
Brought to you by:
ks156
From: David B. <da...@ja...> - 2007-06-07 13:34:33
|
On Mon, 04 Jun 2007 22:29:30 +0200, neimad <ror...@gm...> wrote: > > I have comments and questions about usb_read_TuxDroid(): Looking into it, it seems to be an old function which is not used anymore. In the previous usb firmware, status were read one at a time (4 bytes) and usually 5 different status were generated each 100ms, that's where the loop and the upper bound come from. This didn't make much sense that's why I suggested to change the usb protocol to be able to request all status that are available in one shot. I'm going to remove that function. > (3) The documentation[1] of usb_interrupt_read() doesn't say much, > but I guess it may read fewer bytes than requested, and even > return 0 in case of a timeout. This means that the loop could > have read data in several iterations and still reset the loop > index to 0. The USB IC has a transfer queue and it's not possible to request more bytes than present in the queue. I guess it was a kind of synchronisation trick though I'm not sure it was useful. Sorry for the trouble, David |