From 2c703b1528a287b29817bd1129471e20743cfaa5 Mon Sep 17 00:00:00 2001 From: drashna Date: Mon, 6 Nov 2017 08:43:38 -0800 Subject: [PATCH] Fix RGBLIGHT startup color (#1975) * Fix RGBLIGHT startup color While it's awesome to see the layer indicating code in here (no really!), and the general rule is to not alter the default keymap/code.... The problem with the layer_state_set_kb call handling this, is that the code doesn't seem to be called at startup. So the default layer color won't ever get set on startup. It needs to be called in the init function to be properly set. I've played with this extensively, and if you check my keymaps, that is precisely why I have the setrgb/sethsv in the init function. * Removed typo (pipe) --- keyboards/ergodox_ez/keymaps/default/keymap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index d2976812f..3c15b8a44 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -194,7 +194,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Runs just one time when the keyboard initializes. void matrix_init_user(void) { - +#ifdef RGBLIGHT_COLOR_LAYER_0 + rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); +#endif }; // Runs constantly in the background, in a loop. -- 2.39.2