summaryrefslogtreecommitdiff
path: root/protocol/lufa
diff options
context:
space:
mode:
authortmk <hasu@tmk-kbd.com>2014-12-03 15:50:02 +0900
committertmk <hasu@tmk-kbd.com>2015-01-15 17:08:49 +0900
commitebe437325872045e0b99469f83cb9e877e98112c (patch)
tree36d7fc6928b7a3c75c63a6d5e52e03db5734b7d9 /protocol/lufa
parent86f82dd02db577cd658ca4284cae15e9664db0f2 (diff)
downloadqmk_firmware-ebe437325872045e0b99469f83cb9e877e98112c.tar.gz
qmk_firmware-ebe437325872045e0b99469f83cb9e877e98112c.zip
Fix power saving while USB suspended
- doesn't pwoer save while Bluetooth turns on
Diffstat (limited to 'protocol/lufa')
-rw-r--r--protocol/lufa/lufa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c
index 3d6b3ea00c..cdfc7bc6ad 100644
--- a/protocol/lufa/lufa.c
+++ b/protocol/lufa/lufa.c
@@ -151,6 +151,7 @@ void EVENT_USB_Device_Connect(void)
print("[C]");
/* For battery powered device */
if (!USB_IsInitialized) {
+ USB_Disable();
USB_Init();
USB_Device_EnableSOFEvents();
}
@@ -160,6 +161,7 @@ void EVENT_USB_Device_Disconnect(void)
{
print("[D]");
/* For battery powered device */
+ USB_IsInitialized = false;
/* TODO: This doesn't work. After several plug in/outs can not be enumerated.
if (USB_IsInitialized) {
USB_Disable(); // Disable all interrupts
@@ -177,6 +179,7 @@ void EVENT_USB_Device_Reset(void)
void EVENT_USB_Device_Suspend()
{
print("[S]");
+ matrix_power_down();
#ifdef SLEEP_LED_ENABLE
sleep_led_enable();
#endif