aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/diskloader/src/USBDesc.h
diff options
context:
space:
mode:
Diffstat (limited to 'bootloaders/diskloader/src/USBDesc.h')
-rw-r--r--bootloaders/diskloader/src/USBDesc.h43
1 files changed, 19 insertions, 24 deletions
diff --git a/bootloaders/diskloader/src/USBDesc.h b/bootloaders/diskloader/src/USBDesc.h
index a970fa4..3a7fc55 100644
--- a/bootloaders/diskloader/src/USBDesc.h
+++ b/bootloaders/diskloader/src/USBDesc.h
@@ -16,36 +16,31 @@
** SOFTWARE.
*/
-
-#ifdef CDC_ENABLED
-
-#define CDC_ACM_INTERFACE 0 // CDC ACM
-#define CDC_DATA_INTERFACE 1 // CDC Data
-#define CDC_ENDPOINT_ACM 1
-#define CDC_ENDPOINT_OUT 2
-#define CDC_ENDPOINT_IN 3
-
-#define HID_INTERFACE 2 // HID Interface
-#define HID_ENDPOINT_INT 4
-
-#define INTERFACE_COUNT 3 // 2 for cdc + 1 for hid
-
-#else
-
-#define HID_INTERFACE 2 // HID Interface
-#define HID_ENDPOINT_INT 4
-
-#define INTERFACE_COUNT 1 // 1 for hid
-
-#endif
+#ifndef HID_ENABLED // HID is NOT enabled
+ #define CDC_ACM_INTERFACE 0 // CDC ACM
+ #define CDC_DATA_INTERFACE 1 // CDC Data
+ #define CDC_ENDPOINT_ACM 1
+ #define CDC_ENDPOINT_OUT 2
+ #define CDC_ENDPOINT_IN 3
+ #define INTERFACE_COUNT 2 // 2 for CDC
+#else // HID is enabled
+ #define CDC_ACM_INTERFACE 0 // CDC ACM
+ #define CDC_DATA_INTERFACE 1 // CDC Data
+ #define CDC_ENDPOINT_ACM 1
+ #define CDC_ENDPOINT_OUT 2
+ #define CDC_ENDPOINT_IN 3
+ #define HID_INTERFACE 2 // HID Interface
+ #define HID_ENDPOINT_INT 4
+ #define INTERFACE_COUNT 3 // 2 for CDC + 1 for hid
+#endif
typedef struct
{
ConfigDescriptor config;
-#ifdef CDC_ENABLED
CDCDescriptor cdc;
-#endif
+#ifdef HID_ENABLED
HIDDescriptor hid;
+#endif
} Config;
extern Config USB_ConfigDescriptor PROGMEM;