From 2eca61c761aef06f8aef69d142c354c882ef23fb Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 16 Jun 2022 11:25:24 -0700 Subject: [PATCH] Improved init methods --- betalupi_ergodox.c | 25 ++++++++++++++++++------- keymaps/default/keymap.c | 11 ----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/betalupi_ergodox.c b/betalupi_ergodox.c index 65913ea..66ac7af 100644 --- a/betalupi_ergodox.c +++ b/betalupi_ergodox.c @@ -165,6 +165,8 @@ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { }; #endif + + #ifdef RGB_MATRIX_ENABLE void suspend_power_down_kb(void) { @@ -178,11 +180,8 @@ void suspend_wakeup_init_kb(void) { } const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* driver - * | R location - * | | G location - * | | | B location - * | | | | */ + //{driver, R location, G location, B location} + {0, C3_1, C2_1, C4_1}, // LED1 on right {0, C6_1, C5_1, C7_1}, // LED2 {0, C4_2, C3_2, C5_2}, // LED3 @@ -271,12 +270,22 @@ led_config_t g_led_config = { { 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1 } }; +#endif void keyboard_post_init_kb(void) { + + // Start with matrix enabled + #ifdef RGB_MATRIX_ENABLE rgb_matrix_enable_noeeprom(); + #endif + + // Start with backlight disabled + #ifdef RGBLIGHT_ENABLE + rgblight_disable_noeeprom(); + #endif + keyboard_post_init_user(); } -#endif bool process_record_kb(uint16_t keycode, keyrecord_t *record) { @@ -326,7 +335,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } -void eeconfig_init_kb(void) { // EEPROM is getting reset! + +// EEPROM is getting reset! +void eeconfig_init_kb(void) { keyboard_config.raw = 0; keyboard_config.led_level = 4; keyboard_config.rgb_matrix_enable = true; diff --git a/keymaps/default/keymap.c b/keymaps/default/keymap.c index f7603e8..959493b 100644 --- a/keymaps/default/keymap.c +++ b/keymaps/default/keymap.c @@ -89,17 +89,6 @@ const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { int current_lang = LANG_EN; void keyboard_post_init_user(void) { - // Enable RGB key lights - rgb_matrix_enable_noeeprom(); - - // Set indicator LEDs to min brightness - ergodox_led_all_set(15); - - #ifdef RGBLIGHT_ENABLE - // Disable RGB backlight - rgblight_disable_noeeprom(); - #endif - //set_lang(LANG_EN); }