Browse Source

Fix power saving while USB suspended

- doesn't pwoer save while Bluetooth turns on
core
tmk 9 years ago
parent
commit
d61201e5e4
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      protocol/lufa/lufa.c

+ 3
- 0
protocol/lufa/lufa.c View File

print("[C]"); print("[C]");
/* For battery powered device */ /* For battery powered device */
if (!USB_IsInitialized) { if (!USB_IsInitialized) {
USB_Disable();
USB_Init(); USB_Init();
USB_Device_EnableSOFEvents(); USB_Device_EnableSOFEvents();
} }
{ {
print("[D]"); print("[D]");
/* For battery powered device */ /* For battery powered device */
USB_IsInitialized = false;
/* TODO: This doesn't work. After several plug in/outs can not be enumerated. /* TODO: This doesn't work. After several plug in/outs can not be enumerated.
if (USB_IsInitialized) { if (USB_IsInitialized) {
USB_Disable(); // Disable all interrupts USB_Disable(); // Disable all interrupts
void EVENT_USB_Device_Suspend() void EVENT_USB_Device_Suspend()
{ {
print("[S]"); print("[S]");
matrix_power_down();
#ifdef SLEEP_LED_ENABLE #ifdef SLEEP_LED_ENABLE
sleep_led_enable(); sleep_led_enable();
#endif #endif