aboutsummaryrefslogtreecommitdiffstats
path: root/protocol/lufa/descriptor.h
diff options
context:
space:
mode:
authorGravatar tmk <nobody@nowhere>2012-07-14 02:47:29 +0900
committerGravatar tmk <nobody@nowhere>2012-07-20 13:08:18 +0900
commite075361b6f6bfe24e8d12d125bdab46345087432 (patch)
tree1d51d5cea14bde40fbad8a3354d518fb335c71b1 /protocol/lufa/descriptor.h
parentfb8394da83d1af1e52eac1bdeadf3b5a925b6560 (diff)
downloadqmk_firmware-e075361b6f6bfe24e8d12d125bdab46345087432.tar.gz
Add CONSOLE_ENABLE build option to LUFA.
Diffstat (limited to 'protocol/lufa/descriptor.h')
-rw-r--r--protocol/lufa/descriptor.h50
1 files changed, 35 insertions, 15 deletions
diff --git a/protocol/lufa/descriptor.h b/protocol/lufa/descriptor.h
index 09fb24acc..44f20d5a2 100644
--- a/protocol/lufa/descriptor.h
+++ b/protocol/lufa/descriptor.h
@@ -57,24 +57,26 @@ typedef struct
USB_HID_Descriptor_HID_t Keyboard_HID;
USB_Descriptor_Endpoint_t Keyboard_INEndpoint;
- // Mouse HID Interface
#ifdef MOUSE_ENABLE
+ // Mouse HID Interface
USB_Descriptor_Interface_t Mouse_Interface;
USB_HID_Descriptor_HID_t Mouse_HID;
USB_Descriptor_Endpoint_t Mouse_INEndpoint;
#endif
+#ifdef EXTRAKEY_ENABLE
+ // Extrakey HID Interface
+ USB_Descriptor_Interface_t Extrakey_Interface;
+ USB_HID_Descriptor_HID_t Extrakey_HID;
+ USB_Descriptor_Endpoint_t Extrakey_INEndpoint;
+#endif
+
+#ifdef CONSOLE_ENABLE
// Console HID Interface
USB_Descriptor_Interface_t Console_Interface;
USB_HID_Descriptor_HID_t Console_HID;
USB_Descriptor_Endpoint_t Console_INEndpoint;
USB_Descriptor_Endpoint_t Console_OUTEndpoint;
-
- // Extra HID Interface
-#ifdef EXTRAKEY_ENABLE
- USB_Descriptor_Interface_t Extra_Interface;
- USB_HID_Descriptor_HID_t Extra_HID;
- USB_Descriptor_Endpoint_t Extra_INEndpoint;
#endif
} USB_Descriptor_Configuration_t;
@@ -89,12 +91,16 @@ typedef struct
#endif
#ifdef EXTRAKEY_ENABLE
-# define EXTRA_INTERFACE (MOUSE_INTERFACE + 1)
+# define EXTRAKEY_INTERFACE (MOUSE_INTERFACE + 1)
#else
-# define EXTRA_INTERFACE MOUSE_INTERFACE
+# define EXTRAKEY_INTERFACE MOUSE_INTERFACE
#endif
-#define CONSOLE_INTERFACE (EXTRA_INTERFACE + 1)
+#ifdef CONSOLE_ENABLE
+# define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1)
+#else
+# define CONSOLE_INTERFACE EXTRAKEY_INTERFACE
+#endif
/* nubmer of interfaces */
@@ -103,15 +109,29 @@ typedef struct
// Endopoint number and size
#define KEYBOARD_IN_EPNUM 1
-#define MOUSE_IN_EPNUM 2
-#define CONSOLE_IN_EPNUM 3
-#define CONSOLE_OUT_EPNUM 4
-#define EXTRA_IN_EPNUM 5
+
+#ifdef MOUSE_ENABLE
+# define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1)
+#else
+# define MOUSE_IN_EPNUM KEYBOARD_IN_EPNUM
+#endif
+
+#ifdef EXTRAKEY_ENABLE
+# define EXTRAKEY_IN_EPNUM (MOUSE_IN_EPNUM + 1)
+#else
+# define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM
+#endif
+
+#ifdef CONSOLE_ENABLE
+# define CONSOLE_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1)
+# define CONSOLE_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2)
+#endif
+
#define KEYBOARD_EPSIZE 8
#define MOUSE_EPSIZE 8
+#define EXTRAKEY_EPSIZE 8
#define CONSOLE_EPSIZE 32
-#define EXTRA_EPSIZE 8
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,