From 23e942ae4e66008632667f12c30bbb4f0fae31f7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 26 Mar 2020 18:21:33 +0000 Subject: Enable SLEEP_LED on ATmega32A (#8531) * Port over some AVR backlight logic to SLEEP_LED * Port over some AVR backlight logic to SLEEP_LED - add timer 3 * Port over some AVR backlight logic to SLEEP_LED - clang format * Enable SLEEP_LED within vusb protocol --- tmk_core/protocol/vusb/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tmk_core/protocol/vusb') diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 068c4d8f3d..219989876c 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -20,6 +20,9 @@ #include "timer.h" #include "uart.h" #include "debug.h" +#ifdef SLEEP_LED_ENABLE +# include "sleep_led.h" +#endif #define UART_BAUD_RATE 115200 @@ -59,6 +62,9 @@ int main(void) { initForUsbConnectivity(); keyboard_init(); +#ifdef SLEEP_LED_ENABLE + sleep_led_init(); +#endif debug("main loop\n"); while (1) { @@ -67,10 +73,16 @@ int main(void) { suspended = false; usbSofCount = 0; last_timer = timer_read(); +# ifdef SLEEP_LED_ENABLE + sleep_led_disable(); +# endif } else { // Suspend when no SOF in 3ms-10ms(7.1.7.4 Suspending of USB1.1) if (timer_elapsed(last_timer) > 5) { suspended = true; +# ifdef SLEEP_LED_ENABLE + sleep_led_enable(); +# endif /* uart_putchar('S'); _delay_ms(1); -- cgit v1.2.3