aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/DualVirtualSerial
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-08-22 03:26:20 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-08-22 03:26:20 +0000
commit4cc7f5200beef90c39c8c8310ed7c8b849afb4d9 (patch)
treea8e2e56961f7e39b888e4ded0c38c5ab9cf6f5b6 /Demos/Device/LowLevel/DualVirtualSerial
parent1be3436e895c9937dcd4ebbec33ea199f3e26db2 (diff)
downloadlufa-4cc7f5200beef90c39c8c8310ed7c8b849afb4d9.tar.gz
lufa-4cc7f5200beef90c39c8c8310ed7c8b849afb4d9.tar.bz2
lufa-4cc7f5200beef90c39c8c8310ed7c8b849afb4d9.zip
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.
Diffstat (limited to 'Demos/Device/LowLevel/DualVirtualSerial')
-rw-r--r--Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
index 84a329118..c9a2d9248 100644
--- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
+++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
@@ -161,13 +161,10 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
case REQ_GetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSETUP();
/* Write the line coding data to the control endpoint */
- Endpoint_Write_Control_Stream_LE(LineEncodingData, sizeof(CDC_Line_Coding_t));
-
- /* Finalize the stream transfer to send the last packet or clear the host abort */
+ Endpoint_Write_Control_Stream_LE(LineEncodingData, sizeof(CDC_Line_Coding_t));
Endpoint_ClearOUT();
}
@@ -175,13 +172,10 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
case REQ_SetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSETUP();
/* Read the line coding data in from the host into the global struct */
Endpoint_Read_Control_Stream_LE(LineEncodingData, sizeof(CDC_Line_Coding_t));
-
- /* Finalize the stream transfer to clear the last packet from the host */
Endpoint_ClearIN();
}
@@ -189,9 +183,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
case REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSETUP();
-
Endpoint_ClearStatusStage();
}