summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/vusb
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-03-26 18:21:33 +0000
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commit11efbd1ed34a940d82520ce1c0de4ca409b3372d (patch)
tree9525072584eb54cef9432ddd4f52ae62ea1d9425 /tmk_core/protocol/vusb
parentf6e32b4e8d2ccc6eab5e94b509d2e39ec91ac7d6 (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);