aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/KeyboardMouse
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/ClassDriver/KeyboardMouse')
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c4
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h8
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c21
3 files changed, 18 insertions, 15 deletions
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
index d6471d6e7..207e7829b 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
@@ -147,7 +147,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM),
+ .EndpointAddress = KEYBOARD_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
@@ -184,7 +184,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM),
+ .EndpointAddress = MOUSE_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
index fe41f923e..e35e266c0 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
+++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
@@ -62,11 +62,11 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Keyboard HID reporting IN endpoint. */
- #define KEYBOARD_IN_EPNUM 1
+ /** Endpoint address of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_IN_EPNUM 3
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
/** Size in bytes of each of the HID reporting IN endpoints. */
#define HID_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
index cb2eebf81..7b5caa405 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
@@ -52,11 +52,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = KEYBOARD_IN_EPNUM,
- .ReportINEndpointSize = HID_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = KEYBOARD_IN_EPADDR,
+ .Size = HID_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
},
@@ -72,10 +73,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
.Config =
{
.InterfaceNumber = 1,
-
- .ReportINEndpointNumber = MOUSE_IN_EPNUM,
- .ReportINEndpointSize = HID_EPSIZE,
-
+ .ReportINEndpoint =
+ {
+ .Address = MOUSE_IN_EPADDR,
+ .Size = HID_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevMouseHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer),
},