diff options
Diffstat (limited to 'protocol/lufa/lufa.c')
| -rw-r--r-- | protocol/lufa/lufa.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index 68f30dd16..98c3a68ff 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c | |||
| @@ -151,32 +151,41 @@ void EVENT_USB_Device_StartOfFrame(void) | |||
| 151 | /** Event handler for the USB_ConfigurationChanged event. | 151 | /** Event handler for the USB_ConfigurationChanged event. |
| 152 | * This is fired when the host sets the current configuration of the USB device after enumeration. | 152 | * This is fired when the host sets the current configuration of the USB device after enumeration. |
| 153 | */ | 153 | */ |
| 154 | #if LUFA_VERSION_INTEGER < 0x120730 | ||
| 155 | /* old API 120219 */ | ||
| 156 | #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank) | ||
| 157 | #else | ||
| 158 | /* new API >= 120730 */ | ||
| 159 | #define ENDPOINT_BANK_SINGLE 1 | ||
| 160 | #define ENDPOINT_BANK_DOUBLE 2 | ||
| 161 | #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank) | ||
| 162 | #endif | ||
| 154 | void EVENT_USB_Device_ConfigurationChanged(void) | 163 | void EVENT_USB_Device_ConfigurationChanged(void) |
| 155 | { | 164 | { |
| 156 | bool ConfigSuccess = true; | 165 | bool ConfigSuccess = true; |
| 157 | 166 | ||
| 158 | /* Setup Keyboard HID Report Endpoints */ | 167 | /* Setup Keyboard HID Report Endpoints */ |
| 159 | ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, | 168 | ConfigSuccess &= ENDPOINT_CONFIG(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, |
| 160 | KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); | 169 | KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); |
| 161 | 170 | ||
| 162 | #ifdef MOUSE_ENABLE | 171 | #ifdef MOUSE_ENABLE |
| 163 | /* Setup Mouse HID Report Endpoint */ | 172 | /* Setup Mouse HID Report Endpoint */ |
| 164 | ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, | 173 | ConfigSuccess &= ENDPOINT_CONFIG(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, |
| 165 | MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE); | 174 | MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE); |
| 166 | #endif | 175 | #endif |
| 167 | 176 | ||
| 168 | #ifdef EXTRAKEY_ENABLE | 177 | #ifdef EXTRAKEY_ENABLE |
| 169 | /* Setup Extra HID Report Endpoint */ | 178 | /* Setup Extra HID Report Endpoint */ |
| 170 | ConfigSuccess &= Endpoint_ConfigureEndpoint(EXTRAKEY_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, | 179 | ConfigSuccess &= ENDPOINT_CONFIG(EXTRAKEY_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, |
| 171 | EXTRAKEY_EPSIZE, ENDPOINT_BANK_SINGLE); | 180 | EXTRAKEY_EPSIZE, ENDPOINT_BANK_SINGLE); |
| 172 | #endif | 181 | #endif |
| 173 | 182 | ||
| 174 | #ifdef CONSOLE_ENABLE | 183 | #ifdef CONSOLE_ENABLE |
| 175 | /* Setup Console HID Report Endpoints */ | 184 | /* Setup Console HID Report Endpoints */ |
| 176 | ConfigSuccess &= Endpoint_ConfigureEndpoint(CONSOLE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, | 185 | ConfigSuccess &= ENDPOINT_CONFIG(CONSOLE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, |
| 177 | CONSOLE_EPSIZE, ENDPOINT_BANK_DOUBLE); | 186 | CONSOLE_EPSIZE, ENDPOINT_BANK_DOUBLE); |
| 178 | ConfigSuccess &= Endpoint_ConfigureEndpoint(CONSOLE_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, | 187 | ConfigSuccess &= ENDPOINT_CONFIG(CONSOLE_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, |
| 179 | CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE); | 188 | CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE); |
| 180 | #endif | 189 | #endif |
| 181 | } | 190 | } |
| 182 | 191 | ||
