diff options
Diffstat (limited to 'tmk_core/protocol/lufa')
| -rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 4a30d2257..753762358 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #include "usb_descriptor.h" | 52 | #include "usb_descriptor.h" |
| 53 | #include "lufa.h" | 53 | #include "lufa.h" |
| 54 | #include "quantum.h" | 54 | #include "quantum.h" |
| 55 | #include "usb_device_state.h" | ||
| 55 | #include <util/atomic.h> | 56 | #include <util/atomic.h> |
| 56 | 57 | ||
| 57 | #ifdef NKRO_ENABLE | 58 | #ifdef NKRO_ENABLE |
| @@ -414,7 +415,10 @@ void EVENT_USB_Device_Disconnect(void) { | |||
| 414 | * | 415 | * |
| 415 | * FIXME: Needs doc | 416 | * FIXME: Needs doc |
| 416 | */ | 417 | */ |
| 417 | void EVENT_USB_Device_Reset(void) { print("[R]"); } | 418 | void EVENT_USB_Device_Reset(void) { |
| 419 | print("[R]"); | ||
| 420 | usb_device_state_set_reset(); | ||
| 421 | } | ||
| 418 | 422 | ||
| 419 | /** \brief Event USB Device Connect | 423 | /** \brief Event USB Device Connect |
| 420 | * | 424 | * |
| @@ -422,6 +426,8 @@ void EVENT_USB_Device_Reset(void) { print("[R]"); } | |||
| 422 | */ | 426 | */ |
| 423 | void EVENT_USB_Device_Suspend() { | 427 | void EVENT_USB_Device_Suspend() { |
| 424 | print("[S]"); | 428 | print("[S]"); |
| 429 | usb_device_state_set_suspend(USB_Device_ConfigurationNumber != 0, USB_Device_ConfigurationNumber); | ||
| 430 | |||
| 425 | #ifdef SLEEP_LED_ENABLE | 431 | #ifdef SLEEP_LED_ENABLE |
| 426 | sleep_led_enable(); | 432 | sleep_led_enable(); |
| 427 | #endif | 433 | #endif |
| @@ -437,6 +443,8 @@ void EVENT_USB_Device_WakeUp() { | |||
| 437 | suspend_wakeup_init(); | 443 | suspend_wakeup_init(); |
| 438 | #endif | 444 | #endif |
| 439 | 445 | ||
| 446 | usb_device_state_set_resume(USB_DeviceState == DEVICE_STATE_Configured, USB_Device_ConfigurationNumber); | ||
| 447 | |||
| 440 | #ifdef SLEEP_LED_ENABLE | 448 | #ifdef SLEEP_LED_ENABLE |
| 441 | sleep_led_disable(); | 449 | sleep_led_disable(); |
| 442 | // NOTE: converters may not accept this | 450 | // NOTE: converters may not accept this |
| @@ -529,6 +537,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) { | |||
| 529 | /* Setup digitizer endpoint */ | 537 | /* Setup digitizer endpoint */ |
| 530 | ConfigSuccess &= Endpoint_ConfigureEndpoint((DIGITIZER_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, DIGITIZER_EPSIZE, 1); | 538 | ConfigSuccess &= Endpoint_ConfigureEndpoint((DIGITIZER_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, DIGITIZER_EPSIZE, 1); |
| 531 | #endif | 539 | #endif |
| 540 | |||
| 541 | usb_device_state_set_configuration(USB_DeviceState == DEVICE_STATE_Configured, USB_Device_ConfigurationNumber); | ||
| 532 | } | 542 | } |
| 533 | 543 | ||
| 534 | /* FIXME: Expose this table in the docs somehow | 544 | /* FIXME: Expose this table in the docs somehow |
| @@ -1059,6 +1069,7 @@ void protocol_setup(void) { | |||
| 1059 | #endif | 1069 | #endif |
| 1060 | 1070 | ||
| 1061 | setup_mcu(); | 1071 | setup_mcu(); |
| 1072 | usb_device_state_init(); | ||
| 1062 | keyboard_setup(); | 1073 | keyboard_setup(); |
| 1063 | } | 1074 | } |
| 1064 | 1075 | ||
