diff options
Diffstat (limited to 'Demos')
-rw-r--r-- | Demos/Device/CDC/CDC.c | 6 | ||||
-rw-r--r-- | Demos/Device/GenericHID/GenericHID.c | 8 | ||||
-rw-r--r-- | Demos/Device/Joystick/Joystick.c | 6 | ||||
-rw-r--r-- | Demos/Device/Keyboard/Keyboard.c | 4 | ||||
-rw-r--r-- | Demos/Device/KeyboardMouse/KeyboardMouse.c | 4 | ||||
-rw-r--r-- | Demos/Device/Mouse/Mouse.c | 4 | ||||
-rw-r--r-- | Demos/Device/RNDISEthernet/RNDISEthernet.c | 6 | ||||
-rw-r--r-- | Demos/Device/USBtoSerial/USBtoSerial.c | 10 | ||||
-rw-r--r-- | Demos/Host/MassStorageHost/MassStoreCommands.c | 2 |
9 files changed, 25 insertions, 25 deletions
diff --git a/Demos/Device/CDC/CDC.c b/Demos/Device/CDC/CDC.c index 28bce1ebcd..59aa98ceb8 100644 --- a/Demos/Device/CDC/CDC.c +++ b/Demos/Device/CDC/CDC.c @@ -193,14 +193,14 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
+ /* Acknowledge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSETUP();
+
/* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake
lines. The mask is read in from the wValue parameter in USB_ControlRequest, and can be masked against the
CONTROL_LINE_OUT_* masks to determine the RTS and DTR line states using the following code:
*/
- /* Acknowledge the SETUP packet, ready for data transfer */
- Endpoint_ClearSETUP();
-
/* Acknowledge status stage */
while (!(Endpoint_IsINReady()));
Endpoint_ClearIN();
diff --git a/Demos/Device/GenericHID/GenericHID.c b/Demos/Device/GenericHID/GenericHID.c index 245ddaafc6..695342d0ed 100644 --- a/Demos/Device/GenericHID/GenericHID.c +++ b/Demos/Device/GenericHID/GenericHID.c @@ -165,10 +165,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_GetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
+ uint8_t GenericData[GENERIC_REPORT_SIZE];
+
Endpoint_ClearSETUP();
- uint8_t GenericData[GENERIC_REPORT_SIZE];
-
CreateGenericHIDReport(GenericData);
/* Write the report data to the control endpoint */
@@ -182,13 +182,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_SetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
+ uint8_t GenericData[GENERIC_REPORT_SIZE];
+
Endpoint_ClearSETUP();
/* Wait until the generic report has been sent by the host */
while (!(Endpoint_IsOUTReceived()));
- uint8_t GenericData[GENERIC_REPORT_SIZE];
-
Endpoint_Read_Control_Stream_LE(&GenericData, sizeof(GenericData));
ProcessGenericHIDReport(GenericData);
diff --git a/Demos/Device/Joystick/Joystick.c b/Demos/Device/Joystick/Joystick.c index ee4bc6ad0e..a5c3242feb 100644 --- a/Demos/Device/Joystick/Joystick.c +++ b/Demos/Device/Joystick/Joystick.c @@ -129,11 +129,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket) {
USB_JoystickReport_Data_t JoystickReportData;
+ Endpoint_ClearSETUP();
+
/* Create the next HID report to send to the host */
GetNextReport(&JoystickReportData);
-
- Endpoint_ClearSETUP();
-
+
/* Write the report data to the control endpoint */
Endpoint_Write_Control_Stream_LE(&JoystickReportData, sizeof(JoystickReportData));
diff --git a/Demos/Device/Keyboard/Keyboard.c b/Demos/Device/Keyboard/Keyboard.c index 088943bce6..33545bff6c 100644 --- a/Demos/Device/Keyboard/Keyboard.c +++ b/Demos/Device/Keyboard/Keyboard.c @@ -200,11 +200,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket) {
USB_KeyboardReport_Data_t KeyboardReportData;
+ Endpoint_ClearSETUP();
+
/* Create the next keyboard report for transmission to the host */
CreateKeyboardReport(&KeyboardReportData);
- Endpoint_ClearSETUP();
-
/* Write the report data to the control endpoint */
Endpoint_Write_Control_Stream_LE(&KeyboardReportData, sizeof(KeyboardReportData));
diff --git a/Demos/Device/KeyboardMouse/KeyboardMouse.c b/Demos/Device/KeyboardMouse/KeyboardMouse.c index a85a3786df..dc039eec0f 100644 --- a/Demos/Device/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/KeyboardMouse/KeyboardMouse.c @@ -144,6 +144,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_GetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
+ Endpoint_ClearSETUP();
+
/* Determine if it is the mouse or the keyboard data that is being requested */
if (!(USB_ControlRequest.wIndex))
{
@@ -156,8 +158,6 @@ EVENT_HANDLER(USB_UnhandledControlPacket) ReportSize = sizeof(MouseReportData);
}
- Endpoint_ClearSETUP();
-
/* Write the report data to the control endpoint */
Endpoint_Write_Control_Stream_LE(ReportData, ReportSize);
diff --git a/Demos/Device/Mouse/Mouse.c b/Demos/Device/Mouse/Mouse.c index 2e5f05b429..669b576a6d 100644 --- a/Demos/Device/Mouse/Mouse.c +++ b/Demos/Device/Mouse/Mouse.c @@ -190,10 +190,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket) {
USB_MouseReport_Data_t MouseReportData;
+ Endpoint_ClearSETUP();
+
/* Create the next mouse report for transmission to the host */
CreateMouseReport(&MouseReportData);
-
- Endpoint_ClearSETUP();
/* Write the report data to the control endpoint */
Endpoint_Write_Control_Stream_LE(&MouseReportData, sizeof(MouseReportData));
diff --git a/Demos/Device/RNDISEthernet/RNDISEthernet.c b/Demos/Device/RNDISEthernet/RNDISEthernet.c index 7b81ad85f0..8338cdd00e 100644 --- a/Demos/Device/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/RNDISEthernet/RNDISEthernet.c @@ -172,6 +172,9 @@ EVENT_HANDLER(USB_UnhandledControlPacket) case REQ_GetEncapsulatedResponse:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
+ /* Clear the SETUP packet, ready for data transfer */
+ Endpoint_ClearSETUP();
+
/* Check if a response to the last message is ready */
if (!(MessageHeader->MessageLength))
{
@@ -180,9 +183,6 @@ EVENT_HANDLER(USB_UnhandledControlPacket) MessageHeader->MessageLength = 1;
}
- /* Clear the SETUP packet, ready for data transfer */
- Endpoint_ClearSETUP();
-
/* Write the message response data to the endpoint */
Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, MessageHeader->MessageLength);
diff --git a/Demos/Device/USBtoSerial/USBtoSerial.c b/Demos/Device/USBtoSerial/USBtoSerial.c index dbf4b1b0d6..ea8dcd5995 100644 --- a/Demos/Device/USBtoSerial/USBtoSerial.c +++ b/Demos/Device/USBtoSerial/USBtoSerial.c @@ -188,15 +188,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket) break;
case REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
- {
+ {
+ /* Acknowledge the SETUP packet, ready for data transfer */
+ Endpoint_ClearSETUP();
+
/* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake
lines. The mask is read in from the wValue parameter in USB_ControlRequest, and can be masked against the
CONTROL_LINE_OUT_* masks to determine the RTS and DTR line states using the following code:
*/
-
- /* Acknowledge the SETUP packet, ready for data transfer */
- Endpoint_ClearSETUP();
-
+
/* Acknowledge status stage */
while (!(Endpoint_IsINReady()));
Endpoint_ClearIN();
diff --git a/Demos/Host/MassStorageHost/MassStoreCommands.c b/Demos/Host/MassStorageHost/MassStoreCommands.c index d4df205b1d..4ebc67a777 100644 --- a/Demos/Host/MassStorageHost/MassStoreCommands.c +++ b/Demos/Host/MassStorageHost/MassStoreCommands.c @@ -75,7 +75,7 @@ static uint8_t MassStore_SendCommand(void) {
uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;
- /* Each transmission should have a unique tag value, excluding valued 0 and 0xFFFFFFFF */
+ /* Each transmission should have a unique tag value, excluding values 0 and 0xFFFFFFFF */
if (++MassStore_Tag == 0xFFFFFFFF)
MassStore_Tag = 1;
|