USB_HostRequest renamed to USB_ControlRequest, entire control request header is now...
[pub/USBasp.git] / Demos / Device / CDC / CDC.c
index fb7d74b..28bce1e 100644 (file)
@@ -160,10 +160,10 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
        uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
 \r
        /* Process CDC specific control requests */\r
-       switch (bRequest)\r
+       switch (USB_ControlRequest.bRequest)\r
        {\r
                case REQ_GetLineEncoding:\r
-                       if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
+                       if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {       \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
                                Endpoint_ClearSETUP();\r
@@ -177,7 +177,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                        \r
                        break;\r
                case REQ_SetLineEncoding:\r
-                       if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
+                       if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
                                Endpoint_ClearSETUP();\r
@@ -191,18 +191,12 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
        \r
                        break;\r
                case REQ_SetControlLineState:\r
-                       if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
+                       if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-#if 0\r
                                /* NOTE: Here you can read in the line state mask from the host, to get the current state of the output handshake\r
-                                        lines. The mask is read in from the wValue parameter, and can be masked against the CONTROL_LINE_OUT_* masks\r
-                                        to determine the RTS and DTR line states using the following code:\r
+                                        lines. The mask is read in from the wValue parameter in USB_ControlRequest, and can be masked against the\r
+                                                CONTROL_LINE_OUT_* masks to determine the RTS and DTR line states using the following code:\r
                                */\r
-\r
-                               uint16_t wIndex = Endpoint_Read_Word_LE();\r
-                                       \r
-                               // Do something with the given line states in wIndex\r
-#endif\r
                                \r
                                /* Acknowledge the SETUP packet, ready for data transfer */\r
                                Endpoint_ClearSETUP();\r