diff options
| author | tmk <nobody@nowhere> | 2013-07-29 00:55:49 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-07-29 00:55:49 +0900 |
| commit | 893ff0a799d7d42452cd8d09934380e90d8d3935 (patch) | |
| tree | 2252465e60650562ad7edd91ab4fbba991da429c /protocol/lufa/lufa.c | |
| parent | c7d309e34bf5d05f245811389bea495d814e2111 (diff) | |
| parent | e7c2af78b704bfddb581559d42cc7cc31ffab0bf (diff) | |
| download | firmware-893ff0a799d7d42452cd8d09934380e90d8d3935.tar.gz firmware-893ff0a799d7d42452cd8d09934380e90d8d3935.tar.bz2 firmware-893ff0a799d7d42452cd8d09934380e90d8d3935.zip | |
Merge branch 'lufa_nkro'
Diffstat (limited to 'protocol/lufa/lufa.c')
| -rw-r--r-- | protocol/lufa/lufa.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index a863b8d23..c1617cd05 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c @@ -220,6 +220,12 @@ void EVENT_USB_Device_ConfigurationChanged(void) ConfigSuccess &= ENDPOINT_CONFIG(CONSOLE_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE); #endif + +#ifdef NKRO_ENABLE + /* Setup NKRO HID Report Endpoints */ + ConfigSuccess &= ENDPOINT_CONFIG(NKRO_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, + NKRO_EPSIZE, ENDPOINT_BANK_SINGLE); +#endif } /* @@ -350,15 +356,31 @@ static void send_keyboard(report_keyboard_t *report) if (USB_DeviceState != DEVICE_STATE_Configured) return; - // TODO: handle NKRO report /* Select the Keyboard Report Endpoint */ - Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); +#ifdef NKRO_ENABLE + if (keyboard_nkro) { + Endpoint_SelectEndpoint(NKRO_IN_EPNUM); + } + else +#endif + { + Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); + } /* Check if Keyboard Endpoint Ready for Read/Write */ while (--timeout && !Endpoint_IsReadWriteAllowed()) ; /* Write Keyboard Report Data */ - Endpoint_Write_Stream_LE(report, sizeof(report_keyboard_t), NULL); +#ifdef NKRO_ENABLE + if (keyboard_nkro) { + Endpoint_Write_Stream_LE(report, NKRO_EPSIZE, NULL); + } + else +#endif + { + /* boot mode */ + Endpoint_Write_Stream_LE(report, KEYBOARD_EPSIZE, NULL); + } /* Finalize the stream transfer to send the last packet */ Endpoint_ClearIN(); |
