From b37d77eab32d171ad7b28157a924a4026e2aebd1 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 24 Oct 2010 22:53:57 +0000 Subject: All USB class drivers are now automatically included when LUFA/Drivers/USB.h is included, and no longer need to be seperately included. All LowLevel demos changed to use the constants and types defined in the USB class drivers. --- Demos/Device/LowLevel/Joystick/Descriptors.c | 6 +++--- Demos/Device/LowLevel/Joystick/Descriptors.h | 21 +-------------------- Demos/Device/LowLevel/Joystick/Joystick.c | 2 +- Demos/Device/LowLevel/Joystick/Joystick.h | 3 --- 4 files changed, 5 insertions(+), 27 deletions(-) (limited to 'Demos/Device/LowLevel/Joystick') diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.c b/Demos/Device/LowLevel/Joystick/Descriptors.c index 08674c8d6..fac68871e 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.c +++ b/Demos/Device/LowLevel/Joystick/Descriptors.c @@ -140,12 +140,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .HID_JoystickHID = { - .Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, + .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(01.11), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(JoystickReport) }, @@ -239,7 +239,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, break; case DTYPE_HID: Address = &ConfigurationDescriptor.HID_JoystickHID; - Size = sizeof(USB_Descriptor_HID_t); + Size = sizeof(USB_HID_Descriptor_HID_t); break; case DTYPE_Report: Address = &JoystickReport; diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.h b/Demos/Device/LowLevel/Joystick/Descriptors.h index 76f609715..e58d9a487 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.h +++ b/Demos/Device/LowLevel/Joystick/Descriptors.h @@ -42,25 +42,6 @@ #include /* Type Defines: */ - /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID - * specification for details on the structure elements. - */ - typedef struct - { - USB_Descriptor_Header_t Header; - - uint16_t HIDSpec; - uint8_t CountryCode; - - uint8_t TotalReportDescriptors; - - uint8_t HIDReportType; - uint16_t HIDReportLength; - } USB_Descriptor_HID_t; - - /** Type define for the data type used to store HID report descriptor elements. */ - typedef uint8_t USB_Descriptor_HIDReport_Datatype_t; - /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which * vary between devices, and which describe the device's usage to the host. @@ -69,7 +50,7 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t HID_Interface; - USB_Descriptor_HID_t HID_JoystickHID; + USB_HID_Descriptor_HID_t HID_JoystickHID; USB_Descriptor_Endpoint_t HID_ReportINEndpoint; } USB_Descriptor_Configuration_t; diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index 24f744fdb..0419a7e50 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -112,7 +112,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void) /* Handle HID Class specific requests */ switch (USB_ControlRequest.bRequest) { - case REQ_GetReport: + case HID_REQ_GetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { USB_JoystickReport_Data_t JoystickReportData; diff --git a/Demos/Device/LowLevel/Joystick/Joystick.h b/Demos/Device/LowLevel/Joystick/Joystick.h index e1ae51228..3b02218ad 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.h +++ b/Demos/Device/LowLevel/Joystick/Joystick.h @@ -52,9 +52,6 @@ #include /* Macros: */ - /** HID Class specific request to get the next HID report from the device. */ - #define REQ_GetReport 0x01 - /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 -- cgit v1.2.3