aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
Diffstat (limited to 'Demos')
-rw-r--r--Demos/AudioInput/AudioInput.c3
-rw-r--r--Demos/AudioOutput/AudioOutput.c5
-rw-r--r--Demos/CDC/CDC.c9
-rw-r--r--Demos/DualCDC/DualCDC.c9
-rw-r--r--Demos/Keyboard/Keyboard.c18
-rw-r--r--Demos/KeyboardFullInt/KeyboardFullInt.c18
-rw-r--r--Demos/KeyboardMouse/KeyboardMouse.c4
-rw-r--r--Demos/KeyboardViaInt/KeyboardViaInt.c18
-rw-r--r--Demos/MassStorage/MassStorage.c17
-rw-r--r--Demos/Mouse/Mouse.c14
-rw-r--r--Demos/MouseFullInt/MouseFullInt.c14
-rw-r--r--Demos/MouseViaInt/MouseViaInt.c14
-rw-r--r--Demos/USBtoSerial/USBtoSerial.c9
13 files changed, 109 insertions, 43 deletions
diff --git a/Demos/AudioInput/AudioInput.c b/Demos/AudioInput/AudioInput.c
index 0db41c3c1..6ead7a015 100644
--- a/Demos/AudioInput/AudioInput.c
+++ b/Demos/AudioInput/AudioInput.c
@@ -163,7 +163,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
}
- /* Handshake the request */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
diff --git a/Demos/AudioOutput/AudioOutput.c b/Demos/AudioOutput/AudioOutput.c
index 3d2e3249e..87afd3606 100644
--- a/Demos/AudioOutput/AudioOutput.c
+++ b/Demos/AudioOutput/AudioOutput.c
@@ -193,7 +193,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
Scheduler_SetTaskMode(USB_Audio_Task, TASK_STOP);
}
- /* Handshake the request */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -249,7 +250,7 @@ TASK(USB_Audio_Task)
/* Check to see if the bank is now empty */
if (!(Endpoint_ReadWriteAllowed()))
{
- /* Acknowedge the packet, clear the bank ready for the next packet */
+ /* Acknowledge the packet, clear the bank ready for the next packet */
Endpoint_ClearCurrentBank();
}
diff --git a/Demos/CDC/CDC.c b/Demos/CDC/CDC.c
index eeae625cf..6e933d581 100644
--- a/Demos/CDC/CDC.c
+++ b/Demos/CDC/CDC.c
@@ -171,7 +171,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
/* Write the line coding data to the control endpoint */
@@ -185,7 +185,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
/* Read the line coding data in from the host into the global struct */
@@ -210,10 +210,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
// Do something with the given line states in wIndex
#endif
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
diff --git a/Demos/DualCDC/DualCDC.c b/Demos/DualCDC/DualCDC.c
index 8e6e38907..3c598da42 100644
--- a/Demos/DualCDC/DualCDC.c
+++ b/Demos/DualCDC/DualCDC.c
@@ -209,7 +209,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
/* Write the line coding data to the control endpoint */
@@ -223,7 +223,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
/* Read the line coding data in from the host into the global struct */
@@ -237,10 +237,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetControlLineState:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
- /* Send an empty packet to acknowedge the command (currently unused) */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
diff --git a/Demos/Keyboard/Keyboard.c b/Demos/Keyboard/Keyboard.c
index 22d406dbe..931f08098 100644
--- a/Demos/Keyboard/Keyboard.c
+++ b/Demos/Keyboard/Keyboard.c
@@ -210,10 +210,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
Endpoint_ClearSetupOUT();
- /* Wait until the host is ready to receive the request confirmation */
+ /* Acknowledge status stage */
while (!(Endpoint_IsSetupINReady()));
-
- /* Handshake the request by sending an empty IN packet */
Endpoint_ClearSetupIN();
}
@@ -228,6 +226,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -242,7 +244,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -258,7 +261,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -273,6 +277,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/KeyboardFullInt/KeyboardFullInt.c b/Demos/KeyboardFullInt/KeyboardFullInt.c
index ed081376d..6a15a9233 100644
--- a/Demos/KeyboardFullInt/KeyboardFullInt.c
+++ b/Demos/KeyboardFullInt/KeyboardFullInt.c
@@ -212,10 +212,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
Endpoint_ClearSetupOUT();
- /* Wait until the host is ready to receive the request confirmation */
+ /* Acknowledge status stage */
while (!(Endpoint_IsSetupINReady()));
-
- /* Handshake the request by sending an empty IN packet */
Endpoint_ClearSetupIN();
}
@@ -230,6 +228,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -244,7 +246,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -260,7 +263,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -275,6 +279,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/KeyboardMouse/KeyboardMouse.c b/Demos/KeyboardMouse/KeyboardMouse.c
index 8108a3032..3ee101b8d 100644
--- a/Demos/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/KeyboardMouse/KeyboardMouse.c
@@ -213,10 +213,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
Endpoint_ClearSetupOUT();
- /* Wait until the host is ready to receive the request confirmation */
+ /* Acknowledge status stage */
while (!(Endpoint_IsSetupINReady()));
-
- /* Handshake the request by sending an empty IN packet */
Endpoint_ClearSetupIN();
}
diff --git a/Demos/KeyboardViaInt/KeyboardViaInt.c b/Demos/KeyboardViaInt/KeyboardViaInt.c
index b66506df5..1e724e6fa 100644
--- a/Demos/KeyboardViaInt/KeyboardViaInt.c
+++ b/Demos/KeyboardViaInt/KeyboardViaInt.c
@@ -211,10 +211,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Clear the endpoint data */
Endpoint_ClearSetupOUT();
- /* Wait until the host is ready to receive the request confirmation */
+ /* Acknowledge status stage */
while (!(Endpoint_IsSetupINReady()));
-
- /* Handshake the request by sending an empty IN packet */
Endpoint_ClearSetupIN();
}
@@ -229,6 +227,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -243,7 +245,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -259,7 +262,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -274,6 +278,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/MassStorage/MassStorage.c b/Demos/MassStorage/MassStorage.c
index 34fcee488..92e33073c 100644
--- a/Demos/MassStorage/MassStorage.c
+++ b/Demos/MassStorage/MassStorage.c
@@ -159,10 +159,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_MassStorageReset:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Indicate that the current transfer should be aborted */
- IsMassStoreReset = true;
-
Endpoint_ClearSetupReceived();
+
+ /* Indicate that the current transfer should be aborted */
+ IsMassStoreReset = true;
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -171,9 +174,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearSetupReceived();
+
Endpoint_Write_Byte(TOTAL_LUNS - 1);
+
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/Mouse/Mouse.c b/Demos/Mouse/Mouse.c
index 3e59706c9..da8a4a809 100644
--- a/Demos/Mouse/Mouse.c
+++ b/Demos/Mouse/Mouse.c
@@ -201,6 +201,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -215,7 +219,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -231,7 +236,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -246,6 +252,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/MouseFullInt/MouseFullInt.c b/Demos/MouseFullInt/MouseFullInt.c
index 98782b6cf..7e69d81e7 100644
--- a/Demos/MouseFullInt/MouseFullInt.c
+++ b/Demos/MouseFullInt/MouseFullInt.c
@@ -200,6 +200,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -214,7 +218,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -230,7 +235,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -245,6 +251,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/MouseViaInt/MouseViaInt.c b/Demos/MouseViaInt/MouseViaInt.c
index 445fb4994..465459a36 100644
--- a/Demos/MouseViaInt/MouseViaInt.c
+++ b/Demos/MouseViaInt/MouseViaInt.c
@@ -198,6 +198,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
@@ -212,7 +216,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Set or clear the flag depending on what the host indicates that the current Protocol should be */
UsingReportProtocol = (wValue != 0x0000);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -228,7 +233,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Get idle period in MSB */
IdleCount = (wValue >> 8);
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -243,6 +249,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Send the flag to the host */
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;
diff --git a/Demos/USBtoSerial/USBtoSerial.c b/Demos/USBtoSerial/USBtoSerial.c
index 0495826b9..c7c9e4b04 100644
--- a/Demos/USBtoSerial/USBtoSerial.c
+++ b/Demos/USBtoSerial/USBtoSerial.c
@@ -164,7 +164,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_GetLineEncoding:
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
/* Write the line coding data to the control endpoint */
@@ -178,7 +178,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_SetLineEncoding:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
/* Read the line coding data in from the host into the global struct */
@@ -206,10 +206,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
// Do something with the given line states in wIndex
#endif
- /* Acknowedge the SETUP packet, ready for data transfer */
+ /* Acknowledge the SETUP packet, ready for data transfer */
Endpoint_ClearSetupReceived();
- /* Send an empty packet to acknowedge the command */
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}