Changed all Device mode LowLevel demos and Device Class drivers so that the control request is acknowledged and any data transferred as quickly as possible without any processing inbetween sections, so that long callbacks or event handlers will not break communications with the host by exceeding the maximum control request stage timeout period.
This commit is contained in:
@@ -133,11 +133,10 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
|
||||
{
|
||||
Endpoint_ClearSETUP();
|
||||
Endpoint_ClearStatusStage();
|
||||
|
||||
/* Indicate that the current transfer should be aborted */
|
||||
IsMassStoreReset = true;
|
||||
|
||||
Endpoint_ClearStatusStage();
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -149,8 +148,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
||||
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
|
||||
Endpoint_Write_Byte(TOTAL_LUNS - 1);
|
||||
|
||||
Endpoint_ClearIN();
|
||||
|
||||
Endpoint_ClearIN();
|
||||
Endpoint_ClearStatusStage();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user