Hello,
I modified a "memory" example for AT91SAM7X-EK board and I am trying to read data from Endpoint 2 (OUT). The function USB_ReadEP returns a byte count of data received. But When I try to read the data buffer that is suppose to hold this data it doesn't match what the Host sent.
Here is the code I used:
BYTE * EP_Data; DWORD cnt; // Read EP2 data cnt = USB_ReadEP (0x02, (BYTE*)EP_Data); // Write data back to host USB_WriteEP(0x83, (BYTE *)EP_Data, cnt);
So I get the correct count of bytes received but the data in the EP_Data buffer doesn't match what I sent from the Host. Does anyone know if this is the correct way to read data from Endpoints?
Thanks Mario
Don't you mean: BYTE EP_Data{ENOUGH_ROOM_TO_FIT_THE_ANSWER];
Yes that's what I mean, I was just trying to say that I need an array :)