# LUFA library compile-time options and predefined tokens
LUFA_OPTS = -D USB_DEVICE_ONLY
-LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
-LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
- .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
+ .Endpoint0Size = 8,
+ /* specified in config.h */
.VendorID = VENDOR_ID,
.ProductID = PRODUCT_ID,
.ReleaseNumber = DEVICE_VER,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
- .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
+ .NumberOfConfigurations = 1
};
/*******************************************************************************
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
- .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
+ /* subtract 1 for null terminator */
+ .Header = {.Size = USB_STRING_LEN(sizeof(STR(MANUFACTURER))-1), .Type = DTYPE_String},
.UnicodeString = LSTR(MANUFACTURER)
};
const USB_Descriptor_String_t PROGMEM ProductString =
{
- .Header = {.Size = USB_STRING_LEN(28), .Type = DTYPE_String},
+ /* subtract 1 for null terminator */
+ .Header = {.Size = USB_STRING_LEN(sizeof(STR(PRODUCT))-1), .Type = DTYPE_String},
.UnicodeString = LSTR(PRODUCT)
};
#else
0, // 2
#endif
+#ifdef CONSOLE_ENABLE
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(DEBUG_TX_SIZE) | DEBUG_TX_BUFFER, // 3
+#else
+ 0,
+#endif
#ifdef EXTRAKEY_ENABLE
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(EXTRA_SIZE) | EXTRA_BUFFER, // 4
#else
# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 0)
#endif
+#ifdef CONSOLE_ENABLE
#define DEBUG_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 1)
#define DEBUG_HID_DESC_OFFSET (9+(9+9+7)*DEBUG_HID_DESC_NUM+9)
+#else
+# define DEBUG_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 0)
+#endif
#ifdef EXTRAKEY_ENABLE
# define EXTRA_HID_DESC_NUM (DEBUG_HID_DESC_NUM + 1)
1, // bInterval
#endif
+#ifdef CONSOLE_ENABLE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
0x03, // bmAttributes (0x03=intr)
DEBUG_TX_SIZE, 0, // wMaxPacketSize
1, // bInterval
+#endif
#ifdef EXTRAKEY_ENABLE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
{0x2100, MOUSE_INTERFACE, config1_descriptor+MOUSE_HID_DESC_OFFSET, 9},
{0x2200, MOUSE_INTERFACE, mouse_hid_report_desc, sizeof(mouse_hid_report_desc)},
#endif
+#ifdef CONSOLE_ENABLE
{0x2100, DEBUG_INTERFACE, config1_descriptor+DEBUG_HID_DESC_OFFSET, 9},
{0x2200, DEBUG_INTERFACE, debug_hid_report_desc, sizeof(debug_hid_report_desc)},
+#endif
#ifdef EXTRAKEY_ENABLE
{0x2100, EXTRA_INTERFACE, config1_descriptor+EXTRA_HID_DESC_OFFSET, 9},
{0x2200, EXTRA_INTERFACE, extra_hid_report_desc, sizeof(extra_hid_report_desc)},