diff options
| author | tmk <nobody@nowhere> | 2013-04-13 11:55:57 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-04-13 11:55:57 +0900 |
| commit | 1eb67303ee7b8a037d035e97ffd2d19b030fe3f2 (patch) | |
| tree | 26d7c5574cf333b9a4f1a8f3943301ca41e7b723 /protocol | |
| parent | 1348663a4ff1a4696db39e72bcb751608714de8e (diff) | |
| download | qmk_firmware-1eb67303ee7b8a037d035e97ffd2d19b030fe3f2.tar.gz qmk_firmware-1eb67303ee7b8a037d035e97ffd2d19b030fe3f2.zip | |
Fix LUFA host driver for unconfigured state
Diffstat (limited to 'protocol')
| -rw-r--r-- | protocol/lufa/lufa.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index 7c7072090..a863b8d23 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c | |||
| @@ -347,6 +347,9 @@ static void send_keyboard(report_keyboard_t *report) | |||
| 347 | { | 347 | { |
| 348 | uint8_t timeout = 0; | 348 | uint8_t timeout = 0; |
| 349 | 349 | ||
| 350 | if (USB_DeviceState != DEVICE_STATE_Configured) | ||
| 351 | return; | ||
| 352 | |||
| 350 | // TODO: handle NKRO report | 353 | // TODO: handle NKRO report |
| 351 | /* Select the Keyboard Report Endpoint */ | 354 | /* Select the Keyboard Report Endpoint */ |
| 352 | Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); | 355 | Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); |
| @@ -368,6 +371,9 @@ static void send_mouse(report_mouse_t *report) | |||
| 368 | #ifdef MOUSE_ENABLE | 371 | #ifdef MOUSE_ENABLE |
| 369 | uint8_t timeout = 0; | 372 | uint8_t timeout = 0; |
| 370 | 373 | ||
| 374 | if (USB_DeviceState != DEVICE_STATE_Configured) | ||
| 375 | return; | ||
| 376 | |||
| 371 | /* Select the Mouse Report Endpoint */ | 377 | /* Select the Mouse Report Endpoint */ |
| 372 | Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); | 378 | Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); |
| 373 | 379 | ||
| @@ -386,6 +392,9 @@ static void send_system(uint16_t data) | |||
| 386 | { | 392 | { |
| 387 | uint8_t timeout = 0; | 393 | uint8_t timeout = 0; |
| 388 | 394 | ||
| 395 | if (USB_DeviceState != DEVICE_STATE_Configured) | ||
| 396 | return; | ||
| 397 | |||
| 389 | report_extra_t r = { | 398 | report_extra_t r = { |
| 390 | .report_id = REPORT_ID_SYSTEM, | 399 | .report_id = REPORT_ID_SYSTEM, |
| 391 | .usage = data | 400 | .usage = data |
| @@ -400,6 +409,9 @@ static void send_consumer(uint16_t data) | |||
| 400 | { | 409 | { |
| 401 | uint8_t timeout = 0; | 410 | uint8_t timeout = 0; |
| 402 | 411 | ||
| 412 | if (USB_DeviceState != DEVICE_STATE_Configured) | ||
| 413 | return; | ||
| 414 | |||
| 403 | report_extra_t r = { | 415 | report_extra_t r = { |
| 404 | .report_id = REPORT_ID_CONSUMER, | 416 | .report_id = REPORT_ID_CONSUMER, |
| 405 | .usage = data | 417 | .usage = data |
