void rgblight_init(void) { debug_enable = 1; // Debug ON! dprintf("rgblight_init called.\n"); dprintf("rgblight_init start!\n"); if (!eeconfig_is_enabled()) { dprintf("rgblight_init eeconfig is not enabled.\n"); eeconfig_init(); eeconfig_update_rgblight_default(); } rgblight_config.raw = eeconfig_read_rgblight(); if (!rgblight_config.mode) { dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); eeconfig_update_rgblight_default(); rgblight_config.raw = eeconfig_read_rgblight(); } eeconfig_debug_rgblight(); // display current eeprom values #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_init(); // setup the timer #endif if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); } }
void rgblight_init(void) { /* if already initialized, don't do it again. If you must do it again, extern this and set to false, first. This is a dirty, dirty hack until proper hooks can be added for keyboard startup. */ if (is_rgblight_initialized) { return; } debug_enable = 1; // Debug ON! dprintf("rgblight_init called.\n"); dprintf("rgblight_init start!\n"); if (!eeconfig_is_enabled()) { dprintf("rgblight_init eeconfig is not enabled.\n"); eeconfig_init(); eeconfig_update_rgblight_default(); } rgblight_config.raw = eeconfig_read_rgblight(); RGBLIGHT_SPLIT_SET_CHANGE_HSVS; if (!rgblight_config.mode) { dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); eeconfig_update_rgblight_default(); rgblight_config.raw = eeconfig_read_rgblight(); } rgblight_check_config(); eeconfig_debug_rgblight(); // display current eeprom values #ifdef RGBLIGHT_USE_TIMER rgblight_timer_init(); // setup the timer #endif if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); } is_rgblight_initialized = true; }