Fixed EVENT_USB_CDC_ControLineStateChanged() event not taking the CDC interface struc...
[pub/USBasp.git] / Bootloaders / TeensyHID / TeensyHID.c
index f82e28e..ee6c91a 100644 (file)
@@ -81,7 +81,7 @@ int main(void)
 /** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
  *  to relay data to and from the attached USB host.\r
  */\r
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup HID Report Endpoint */\r
        Endpoint_ConfigureEndpoint(HID_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -93,15 +93,15 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
-       switch (bRequest)\r
+       switch (USB_ControlRequest.bRequest)\r
        {\r
                case REQ_SetReport:\r
-                       if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
+                       if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
                        {\r
-                               Endpoint_ClearControlSETUP();\r
+                               Endpoint_ClearSETUP();\r
                                \r
                                /* Wait until the command (report) has been sent by the host */\r
                                while (!(Endpoint_IsOUTReceived()));\r
@@ -126,7 +126,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                                /* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
                                                if (!(Endpoint_BytesInEndpoint()))\r
                                                {\r
-                                                       Endpoint_ClearControlOUT();\r
+                                                       Endpoint_ClearOUT();\r
                                                        while (!(Endpoint_IsOUTReceived()));\r
                                                }\r
 \r
@@ -142,11 +142,11 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                        boot_rww_enable();\r
                                }\r
 \r
-                               Endpoint_ClearControlOUT();\r
+                               Endpoint_ClearOUT();\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
-                               Endpoint_ClearControlIN();\r
+                               Endpoint_ClearIN();\r
                        }\r
                        \r
                        break;\r