From 9ae6f4f927bc27012929785e0f7479501406331f Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Thu, 24 May 2018 15:27:43 -0700 Subject: Wait for QMK to initialize before configuring RGB (#3030) Wait for 1 second before turning on RGB to get debug messages on console. - configure HSV color, on a brand new pro micro the default values are 0, 0, 0 --- keyboards/bigswitch/bigswitch.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'keyboards/bigswitch/bigswitch.c') diff --git a/keyboards/bigswitch/bigswitch.c b/keyboards/bigswitch/bigswitch.c index 05935f2e9e..3cc11e6026 100644 --- a/keyboards/bigswitch/bigswitch.c +++ b/keyboards/bigswitch/bigswitch.c @@ -16,7 +16,18 @@ along with this program. If not, see . */ #include "bigswitch.h" +volatile uint8_t runonce = true; +static uint16_t my_timer; + void matrix_init_user(void) { - rgblight_enable(); - rgblight_mode(9); + my_timer = timer_read(); +} + +void matrix_scan_user(void) { + if (runonce && timer_elapsed(my_timer) > 1000) { + runonce = false; + rgblight_sethsv(0x0, 0xff, 0x80); + rgblight_mode(9); + rgblight_enable(); + } } -- cgit v1.2.3