summaryrefslogtreecommitdiff
path: root/protocol/lufa/descriptor.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-06-29 03:33:59 +0900
committertmk <nobody@nowhere>2012-06-29 03:33:59 +0900
commitf2ebac101d367ee091f54b8d43b39a4d74f3b90e (patch)
tree474b840ce43102fe634d62740637e30a0118b5ce /protocol/lufa/descriptor.h
parent52011f08c9b4fcfc55817d24bdc4b4ff7b4fe06f (diff)
downloadqmk_firmware-f2ebac101d367ee091f54b8d43b39a4d74f3b90e.tar.gz
qmk_firmware-f2ebac101d367ee091f54b8d43b39a4d74f3b90e.zip
Add conditional compile for MOUSE_ENABLE and EXTRAKEY_ENABLE.
Diffstat (limited to 'protocol/lufa/descriptor.h')
-rw-r--r--protocol/lufa/descriptor.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/protocol/lufa/descriptor.h b/protocol/lufa/descriptor.h
index 6b1b4d4845..19bce999f2 100644
--- a/protocol/lufa/descriptor.h
+++ b/protocol/lufa/descriptor.h
@@ -51,9 +51,11 @@ typedef struct
USB_Descriptor_Endpoint_t Keyboard_INEndpoint;
// Mouse HID Interface
+#ifdef MOUSE_ENABLE
USB_Descriptor_Interface_t Mouse_Interface;
USB_HID_Descriptor_HID_t Mouse_HID;
USB_Descriptor_Endpoint_t Mouse_INEndpoint;
+#endif
// Console HID Interface
USB_Descriptor_Interface_t Console_Interface;
@@ -62,20 +64,35 @@ typedef struct
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;
-/* nubmer of interfaces */
-#define TOTAL_INTERFACES 4
-
/* index of interface */
#define KEYBOARD_INTERFACE 0
-#define MOUSE_INTERFACE 1
-#define CONSOLE_INTERFACE 2
-#define EXTRA_INTERFACE 3
+
+#ifdef MOUSE_ENABLE
+# define MOUSE_INTERFACE (KEYBOARD_INTERFACE + 1)
+#else
+# define MOUSE_INTERFACE KEYBOARD_INTERFACE
+#endif
+
+#ifdef EXTRAKEY_ENABLE
+# define EXTRA_INTERFACE (MOUSE_INTERFACE + 1)
+#else
+# define EXTRA_INTERFACE MOUSE_INTERFACE
+#endif
+
+#define CONSOLE_INTERFACE (EXTRA_INTERFACE + 1)
+
+
+/* nubmer of interfaces */
+#define TOTAL_INTERFACES (CONSOLE_INTERFACE + 1)
+
// Endopoint number and size
#define KEYBOARD_IN_EPNUM 1