From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- tmk_core/protocol/vusb/main.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'tmk_core/protocol/vusb/main.c') diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 86c2188c87..f8322d94ac 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -21,19 +21,16 @@ #include "uart.h" #include "debug.h" - #define UART_BAUD_RATE 115200 - /* This is from main.c of USBaspLoader */ -static void initForUsbConnectivity(void) -{ +static void initForUsbConnectivity(void) { uint8_t i = 0; usbInit(); /* enforce USB re-enumerate: */ - usbDeviceDisconnect(); /* do this while interrupts are disabled */ - while(--i){ /* fake USB disconnect for > 250 ms */ + usbDeviceDisconnect(); /* do this while interrupts are disabled */ + while (--i) { /* fake USB disconnect for > 250 ms */ wdt_reset(); _delay_ms(1); } @@ -41,8 +38,7 @@ static void initForUsbConnectivity(void) sei(); } -int main(void) -{ +int main(void) { bool suspended = false; #if USB_COUNT_SOF uint16_t last_timer = timer_read(); @@ -68,26 +64,26 @@ int main(void) while (1) { #if USB_COUNT_SOF if (usbSofCount != 0) { - suspended = false; + suspended = false; usbSofCount = 0; - last_timer = timer_read(); + last_timer = timer_read(); } else { // Suspend when no SOF in 3ms-10ms(7.1.7.4 Suspending of USB1.1) if (timer_elapsed(last_timer) > 5) { suspended = true; -/* - uart_putchar('S'); - _delay_ms(1); - cli(); - set_sleep_mode(SLEEP_MODE_PWR_DOWN); - sleep_enable(); - sleep_bod_disable(); - sei(); - sleep_cpu(); - sleep_disable(); - _delay_ms(10); - uart_putchar('W'); -*/ + /* + uart_putchar('S'); + _delay_ms(1); + cli(); + set_sleep_mode(SLEEP_MODE_PWR_DOWN); + sleep_enable(); + sleep_bod_disable(); + sei(); + sleep_cpu(); + sleep_disable(); + _delay_ms(10); + uart_putchar('W'); + */ } } #endif -- cgit v1.2.3 From 64b7cfe735339193ae78fe0f13029b0e027af7a7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 29 Oct 2019 22:53:11 +0000 Subject: Refactor ps2avrgb i2c ws2812 to core (#7183) * Refactor ps2avrgb i2c ws2812 to core * Refactor jj40 to use ws2812 i2c driver * Refactor ps2avrgb template to use ws2812 i2c driver * Add ws2812 stub files * clang-format and driver config * Add ws2812 driver docs * Fix default config values * Update tmk_core/protocol/vusb/main.c Co-Authored-By: Drashna Jaelre --- tmk_core/protocol/vusb/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tmk_core/protocol/vusb/main.c') diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index f8322d94ac..8cc736497d 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -20,6 +20,11 @@ #include "timer.h" #include "uart.h" #include "debug.h" +#include "rgblight_reconfig.h" + +#if (defined(RGB_MIDI) | defined(RGBLIGHT_ANIMATIONS)) & defined(RGBLIGHT_ENABLE) +# include "rgblight.h" +#endif #define UART_BAUD_RATE 115200 @@ -94,6 +99,10 @@ int main(void) { // To prevent failing to configure NOT scan keyboard during configuration if (usbConfiguration && usbInterruptIsReady()) { keyboard_task(); + +#if defined(RGBLIGHT_ANIMATIONS) && defined(RGBLIGHT_ENABLE) + rgblight_task(); +#endif } vusb_transfer_keyboard(); } -- cgit v1.2.3 From 22812aee5c207c35010c4b5478af6039c4f2b1ef Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 31 Oct 2019 05:30:21 +0000 Subject: rgblight_task logic fixes (#7214) --- tmk_core/protocol/vusb/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmk_core/protocol/vusb/main.c') diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 8cc736497d..e6291900e6 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -22,7 +22,7 @@ #include "debug.h" #include "rgblight_reconfig.h" -#if (defined(RGB_MIDI) | defined(RGBLIGHT_ANIMATIONS)) & defined(RGBLIGHT_ENABLE) +#if (defined(RGB_MIDI) || defined(RGBLIGHT_ANIMATIONS)) && defined(RGBLIGHT_ENABLE) # include "rgblight.h" #endif -- cgit v1.2.3