From f2ebac101d367ee091f54b8d43b39a4d74f3b90e Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 29 Jun 2012 03:33:59 +0900 Subject: Add conditional compile for MOUSE_ENABLE and EXTRAKEY_ENABLE. --- protocol/lufa/lufa.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'protocol/lufa/lufa.c') diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index 09da96b2e5..f485e24bf0 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c @@ -50,7 +50,9 @@ static uint8_t keyboard_led_stats = 0; // TODO: impl Control Request GET_REPORT static report_keyboard_t keyboard_report_sent; +#ifdef MOUSE_ENABLE static report_mouse_t mouse_report_sent; +#endif /* Host driver */ static uint8_t keyboard_leds(void); @@ -171,19 +173,23 @@ void EVENT_USB_Device_ConfigurationChanged(void) ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); +#ifdef MOUSE_ENABLE /* Setup Mouse HID Report Endpoint */ ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE); +#endif + +#ifdef EXTRAKEY_ENABLE + /* Setup Extra HID Report Endpoint */ + ConfigSuccess &= Endpoint_ConfigureEndpoint(EXTRA_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, + EXTRA_EPSIZE, ENDPOINT_BANK_SINGLE); +#endif /* Setup Console HID Report Endpoints */ ConfigSuccess &= Endpoint_ConfigureEndpoint(CONSOLE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE); ConfigSuccess &= Endpoint_ConfigureEndpoint(CONSOLE_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE); - - /* Setup Extra HID Report Endpoint */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(EXTRA_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - EXTRA_EPSIZE, ENDPOINT_BANK_SINGLE); } /* @@ -222,15 +228,19 @@ void EVENT_USB_Device_ControlRequest(void) ReportData = (uint8_t*)&keyboard_report_sent; ReportSize = sizeof(keyboard_report_sent); break; +#ifdef MOUSE_ENABLE case MOUSE_INTERFACE: // TODO: test/check ReportData = (uint8_t*)&mouse_report_sent; ReportSize = sizeof(mouse_report_sent); break; - case CONSOLE_INTERFACE: - break; +#endif +#ifdef EXTRAKEY_ENABLE case EXTRA_INTERFACE: break; +#endif + case CONSOLE_INTERFACE: + break; } /* Write the report data to the control endpoint */ @@ -258,12 +268,16 @@ void EVENT_USB_Device_ControlRequest(void) /* Read in the LED report from the host */ keyboard_led_stats = Endpoint_Read_8(); break; +#ifdef MOUSE_ENABLE case MOUSE_INTERFACE: break; - case CONSOLE_INTERFACE: - break; +#endif +#ifdef EXTRAKEY_ENABLE case EXTRA_INTERFACE: break; +#endif + case CONSOLE_INTERFACE: + break; } Endpoint_ClearOUT(); @@ -302,6 +316,7 @@ static void send_keyboard(report_keyboard_t *report) static void send_mouse(report_mouse_t *report) { +#ifdef MOUSE_ENABLE /* Select the Mouse Report Endpoint */ Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); @@ -315,6 +330,7 @@ static void send_mouse(report_mouse_t *report) Endpoint_ClearIN(); } mouse_report_sent = *report; +#endif } typedef struct { -- cgit v1.2.3