Knowing when a transfer is complete.
Posted: Wed Aug 12, 2009 10:51 pm
Simple question really, is there anyway of knowing (device-side) when an endpoint0 transfer to the host has completed?
I would prefer to not use usbFunctionRead as my data is contained in a static RAM buffer that could be easily read by usbFunctionSetup alone.
I currently have something like this but I am not entirely sure that the driver is fully done even with that:
Any suggestions?
I would prefer to not use usbFunctionRead as my data is contained in a static RAM buffer that could be easily read by usbFunctionSetup alone.
I currently have something like this but I am not entirely sure that the driver is fully done even with that:
Code: Select all
uchar usbFunctionRead(uchar *data, uchar len)
{
uchar i;
if(len > bytesRemaining)
len = bytesRemaining;
bytesRemaining -= len;
for(i = 0; i < len; i++)
data[i] = getData(currentPosition);
if(len < 8)
tx_complete = 1;
return len;
}
Any suggestions?