summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/vusb
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-03-26 18:21:33 +0000
committerGitHub <noreply@github.com>2020-03-26 18:21:33 +0000
commit23e942ae4e66008632667f12c30bbb4f0fae31f7 (patch)
treea5d3fc389ee9444635abeaba2126d500e595676e /tmk_core/protocol/vusb
parentc077300e19a9c788b3d30bc65c1198fc88de3d5b (diff)
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
Diffstat (limited to 'tmk_core/protocol/vusb')
-rw-r--r--tmk_core/protocol/vusb/main.c12
1 files changed, 12 insertions, 0 deletions
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);