aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--protocol/lufa.mk14
-rw-r--r--protocol/lufa/lufa.c29
3 files changed, 30 insertions, 15 deletions
diff --git a/README.md b/README.md
index cf09a9407..072de0a38 100644
--- a/README.md
+++ b/README.md
@@ -659,4 +659,4 @@ Files & Directories
659License 659License
660------- 660-------
661Under `GPL` 2 or later. Some protocol files are under `Modified BSD License`. 661Under `GPL` 2 or later. Some protocol files are under `Modified BSD License`.
662PJRC stack has its own license. 662LUFA and PJRC stack have their own license respectively.
diff --git a/protocol/lufa.mk b/protocol/lufa.mk
index bf6fc97b8..443b85344 100644
--- a/protocol/lufa.mk
+++ b/protocol/lufa.mk
@@ -1,10 +1,16 @@
1LUFA_DIR = protocol/lufa 1LUFA_DIR = protocol/lufa
2 2
3# Path to the LUFA library 3# Path to the LUFA library
4LUFA_PATH = protocol/lufa/LUFA-120219 4LUFA_PATH ?= protocol/lufa/LUFA-120730
5 5
6# Create the LUFA source path variables by including the LUFA root makefile 6# Create the LUFA source path variables by including the LUFA makefile
7include $(TOP_DIR)/$(LUFA_PATH)/LUFA/makefile 7ifneq (, $(wildcard $(TOP_DIR)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
8 # New build system from 20120730
9 LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
10 include $(TOP_DIR)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk
11else
12 include $(TOP_DIR)/$(LUFA_PATH)/LUFA/makefile
13endif
8 14
9LUFA_SRC = $(LUFA_DIR)/lufa.c \ 15LUFA_SRC = $(LUFA_DIR)/lufa.c \
10 $(LUFA_DIR)/descriptor.c \ 16 $(LUFA_DIR)/descriptor.c \
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
154void EVENT_USB_Device_ConfigurationChanged(void) 163void 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