From 359fbfe14d00ab378f85a36664820ea9ba538c3f Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 10 May 2012 19:24:58 +0000 Subject: Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros. --- Demos/Device/ClassDriver/Keyboard/Descriptors.c | 4 ++-- Demos/Device/ClassDriver/Keyboard/Descriptors.h | 4 ++-- Demos/Device/ClassDriver/Keyboard/Keyboard.c | 11 ++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'Demos/Device/ClassDriver/Keyboard') diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.c b/Demos/Device/ClassDriver/Keyboard/Descriptors.c index cb7852667..c74368bb0 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.c @@ -131,10 +131,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM), + .EndpointAddress = KEYBOARD_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.h b/Demos/Device/ClassDriver/Keyboard/Descriptors.h index 370489514..f032b728e 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_EPNUM 1 + /** Endpoint address of the Keyboard HID reporting IN endpoint. */ + #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Keyboard HID reporting IN endpoint. */ #define KEYBOARD_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index 15a7f1760..24bf8d5fa 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = KEYBOARD_EPNUM, - .ReportINEndpointSize = KEYBOARD_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = KEYBOARD_EPADDR, + .Size = KEYBOARD_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevKeyboardHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer), }, -- cgit v1.2.3