X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Flufa%2Fdescriptor.h;h=61c42c9dfc0dc80ef3649e1debbfbf1dcf9fa351;hb=85c3c5926ca0d47e5c3a8c58a12947f2ea69cd30;hp=24ce420e6ac477634dc931de7c09659f63220bf0;hpb=cd413550693564cb17da362f27a540d577271d36;p=qmk_firmware.git diff --git a/tmk_core/protocol/lufa/descriptor.h b/tmk_core/protocol/lufa/descriptor.h index 24ce420e6..61c42c9df 100644 --- a/tmk_core/protocol/lufa/descriptor.h +++ b/tmk_core/protocol/lufa/descriptor.h @@ -133,10 +133,19 @@ typedef struct /* index of interface */ #define KEYBOARD_INTERFACE 0 +// It is important that the Raw HID interface is at a constant +// interface number, to support Linux/OSX platforms and chrome.hid +// If Raw HID is enabled, let it be always 1. +#ifdef RAW_ENABLE +# define RAW_INTERFACE (KEYBOARD_INTERFACE + 1) +#else +# define RAW_INTERFACE KEYBOARD_INTERFACE +#endif + #ifdef MOUSE_ENABLE -# define MOUSE_INTERFACE (KEYBOARD_INTERFACE + 1) +# define MOUSE_INTERFACE (RAW_INTERFACE + 1) #else -# define MOUSE_INTERFACE KEYBOARD_INTERFACE +# define MOUSE_INTERFACE RAW_INTERFACE #endif #ifdef EXTRAKEY_ENABLE @@ -145,16 +154,10 @@ typedef struct # define EXTRAKEY_INTERFACE MOUSE_INTERFACE #endif -#ifdef RAW_ENABLE -# define RAW_INTERFACE (EXTRAKEY_INTERFACE + 1) -#else -# define RAW_INTERFACE EXTRAKEY_INTERFACE -#endif - #ifdef CONSOLE_ENABLE -# define CONSOLE_INTERFACE (RAW_INTERFACE + 1) +# define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1) #else -# define CONSOLE_INTERFACE RAW_INTERFACE +# define CONSOLE_INTERFACE EXTRAKEY_INTERFACE #endif #ifdef NKRO_ENABLE @@ -238,7 +241,8 @@ typedef struct # define CDC_OUT_EPNUM MIDI_STREAM_OUT_EPNUM #endif -#if defined(__AVR_ATmega32U2__) && CDC_OUT_EPNUM > 4 +#if (defined(__AVR_ATmega32U2__) && CDC_OUT_EPNUM > 4) || \ + (defined(__AVR_ATmega32U4__) && CDC_OUT_EPNUM > 6) # error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL)" #endif @@ -254,7 +258,7 @@ typedef struct uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, + const uint16_t wIndex, const void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);