Problem with USB HID | Cypress Semiconductor
Problem with USB HID
sorry for my english. I'm using the USB HID Example AN82072 with some changes. I change this to a 64 bit data performance. It works. But when i add some code in the program loop, i cant receive data from the PC. Send to PC is ok. I think is timing problem, but what can i do? Here is a little piece of the code.
if(USBFS_GetEPState(IN_ENDPOINT) == USBFS_IN_BUFFER_EMPTY)
/* Load data located in IN_Data_Buffer and load it into the IN endpoint */
USBFS_LoadInEP(IN_ENDPOINT, IN_Data_Buffer, MAX_NUM_BYTES);
/* Enable the OUT endpoint to recieve data */
/* Check to see if the OUT Endpoint is full from a recieved transaction. */
if(USBFS_GetEPState(OUT_ENDPOINT) == USBFS_OUT_BUFFER_FULL)
/* Get the number of bytes recieved */
Byte_Count = USBFS_GetEPCount(OUT_ENDPOINT);
/* Read the OUT endpoint and store data in OUT_Data_Buffer */
USBFS_ReadOutEP(OUT_ENDPOINT, OUT_Data_Buffer, Byte_Count);
/* Re-enable OUT endpoint */
temperature = MeasureThermoCoupleTemp();
With this code "temperature = MeasureThermoCoupleTemp();" it doesn't work. Without this code i can receive data from PC.