Fix build errors in Joystick device demo and library LEDs driver (on *nix systems).
[pub/USBasp.git] / Demos / Device / USBtoSerial / USBtoSerial.c
index e1c22fc..ea8dcd5 100644 (file)
@@ -153,10 +153,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
@@ -170,7 +170,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
@@ -187,22 +187,16 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
        \r
                        break;\r
                case REQ_SetControlLineState:\r
-                       if (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
-                               */\r
-\r
-                               uint16_t wIndex = Endpoint_Read_Word_LE();\r
-                                       \r
-                               // Do something with the given line states in wIndex\r
-#endif\r
-                               \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
                                \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 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
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
                                Endpoint_ClearIN();\r