aboutsummaryrefslogtreecommitdiff
path: root/protocol/lufa/lufa.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-11-24 13:50:33 +0900
committertmk <nobody@nowhere>2014-11-24 13:50:33 +0900
commit363950982a291c3bfa03ac6362061b1d37dc06b0 (patch)
treec46fc53fe00137ced3c8edd3d0766ee844f77516 /protocol/lufa/lufa.c
parenteb90ed6238426db9367e294abfaefb5de07564f5 (diff)
parent60096e11c77980ca6b54674c5b68248e8aa15d8d (diff)
downloadqmk_firmware-363950982a291c3bfa03ac6362061b1d37dc06b0.tar.gz
qmk_firmware-363950982a291c3bfa03ac6362061b1d37dc06b0.zip
Merge branch 'rn42' into merge_rn42
Conflicts: .gitignore common.mk common/debug_config.h common/print.h
Diffstat (limited to 'protocol/lufa/lufa.c')
-rw-r--r--protocol/lufa/lufa.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c
index 16a602df1..6802f3b63 100644
--- a/protocol/lufa/lufa.c
+++ b/protocol/lufa/lufa.c
@@ -148,10 +148,23 @@ static void Console_Task(void)
148*/ 148*/
149void EVENT_USB_Device_Connect(void) 149void EVENT_USB_Device_Connect(void)
150{ 150{
151 /* For battery powered device */
152 if (!USB_IsInitialized) {
153 USB_Init();
154 USB_Device_EnableSOFEvents();
155 }
151} 156}
152 157
153void EVENT_USB_Device_Disconnect(void) 158void EVENT_USB_Device_Disconnect(void)
154{ 159{
160 /* For battery powered device */
161/* TODO: This doesn't work. After several plug in/outs can not be enumerated.
162 if (USB_IsInitialized) {
163 USB_Disable(); // Disable all interrupts
164 USB_Controller_Enable();
165 USB_INT_Enable(USB_INT_VBUSTI);
166 }
167*/
155} 168}
156 169
157void EVENT_USB_Device_Reset(void) 170void EVENT_USB_Device_Reset(void)
@@ -574,7 +587,7 @@ int main(void)
574 print("Keyboard start.\n"); 587 print("Keyboard start.\n");
575 while (1) { 588 while (1) {
576 while (USB_DeviceState == DEVICE_STATE_Suspended) { 589 while (USB_DeviceState == DEVICE_STATE_Suspended) {
577 suspend_power_down(); 590 suspend_power_down(WDTO_120MS);
578 if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) { 591 if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) {
579 USB_Device_SendRemoteWakeup(); 592 USB_Device_SendRemoteWakeup();
580 } 593 }