X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=tmk_core%2Fprotocol%2Fchibios%2Fusb_main.c;h=f8a31593b039e373dc1fe8a029d6fcbc58f58e08;hb=9cc281b4efdf2dcd817189bb8e633578d638bc45;hp=b10e5daaf55a7a8989baa1c270af8529cb5e68e5;hpb=d057e5157ed22508ce87f8fef113be52674ba209;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index b10e5daa..f8a31593 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -20,6 +20,11 @@ #include "usb_main.h" +#include "debug.h" +#ifdef SLEEP_LED_ENABLE +#include "sleep_led.h" +#endif + /* --------------------------------------------------------- * Global interface variables and declarations * --------------------------------------------------------- @@ -752,6 +757,7 @@ static const USBEndpointConfig nkro_ep_config = { static void usb_event_cb(USBDriver *usbp, usbevent_t event) { switch(event) { case USB_EVENT_RESET: + //TODO: from ISR! print("[R]"); return; case USB_EVENT_ADDRESS: @@ -778,9 +784,21 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { return; case USB_EVENT_SUSPEND: + //TODO: from ISR! print("[S]"); + //TODO: signal suspend? +#ifdef SLEEP_LED_ENABLE + sleep_led_enable(); +#endif /* SLEEP_LED_ENABLE */ return; case USB_EVENT_WAKEUP: + //TODO: from ISR! print("[W]"); + //TODO: suspend_wakeup_init(); +#ifdef SLEEP_LED_ENABLE + sleep_led_disable(); + // NOTE: converters may not accept this + led_set(host_keyboard_leds()); +#endif /* SLEEP_LED_ENABLE */ return; case USB_EVENT_STALLED: