]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Wait for QMK to initialize before configuring RGB (#3030)
authorYan-Fa Li <yanfali@gmail.com>
Thu, 24 May 2018 22:27:43 +0000 (15:27 -0700)
committerDrashna Jaelre <drashna@live.com>
Thu, 24 May 2018 22:27:43 +0000 (15:27 -0700)
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
keyboards/bigswitch/config.h

index 05935f2e9e7e5b6a67fa60988bcd51d682423fa5..3cc11e602676a396a8d7c299c7e79637fdc40487 100644 (file)
@@ -16,7 +16,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #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();
+  }
 }
index b6cbf06e92d2a027b9f0fa24288df71619725e8e..cc290fd79b1b53b2934e64212b803d33636d49f3 100755 (executable)
@@ -53,7 +53,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifdef RGBLIGHT_ENABLE
 #define RGB_DI_PIN D3
 #define RGBLIGHT_ANIMATIONS
-#define RGBLED_NUM 5
+#define RGBLED_NUM 8
 #endif
 
 #endif