aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-04-23 13:28:12 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-04-23 13:28:12 +0000
commitc20a94a4e84c89debf5e7109482ede708a694a0c (patch)
tree94ec05a96fa7071bcb7eb60a30bc5ab246ef8cda /Demos
parent9cec85bfd92a77a97e7d12625897de2682dfacd7 (diff)
downloadlufa-c20a94a4e84c89debf5e7109482ede708a694a0c.tar.gz
lufa-c20a94a4e84c89debf5e7109482ede708a694a0c.tar.bz2
lufa-c20a94a4e84c89debf5e7109482ede708a694a0c.zip
Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set Feature request was not being handled).
Renamed the FEATURELESS_CONTROL_ONLY_DEVICE compile-time token to CONTROL_ONLY_DEVICE.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Device/CDC/CDC.c6
-rw-r--r--Demos/Device/GenericHID/GenericHID.c8
-rw-r--r--Demos/Device/Joystick/Joystick.c6
-rw-r--r--Demos/Device/Keyboard/Keyboard.c4
-rw-r--r--Demos/Device/KeyboardMouse/KeyboardMouse.c4
-rw-r--r--Demos/Device/Mouse/Mouse.c4
-rw-r--r--Demos/Device/RNDISEthernet/RNDISEthernet.c6
-rw-r--r--Demos/Device/USBtoSerial/USBtoSerial.c10
-rw-r--r--Demos/Host/MassStorageHost/MassStoreCommands.c2
9 files changed, 25 insertions, 25 deletions
diff --git a/Demos/Device/CDC/CDC.c b/Demos/Device/CDC/CDC.c
index 28bce1ebc..59aa98ceb 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 245ddaafc..695342d0e 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 ee4bc6ad0..a5c3242fe 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 088943bce..33545bff6 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 a85a3786d..dc039eec0 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 2e5f05b42..669b576a6 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 7b81ad85f..8338cdd00 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 dbf4b1b0d..ea8dcd599 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 d4df205b1..4ebc67a77 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;