-void rgb_matrix_init_drivers(void) {
- // Initialize TWI
- i2c_init();
- IS31FL3731_init( DRIVER_ADDR_1 );
- IS31FL3731_init( DRIVER_ADDR_2 );
-
- for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) {
- bool enabled = true;
- // This only caches it for later
- IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
- }
- // This actually updates the LED drivers
- IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
-
- // TODO: put the 1 second startup delay here?
-
- // clear the key hits
- for ( int led=0; led<DRIVER_LED_TOTAL; led++ ) {
- g_key_hit[led] = 255;
- }
-
-
- if (!eeconfig_is_enabled()) {
- dprintf("rgb_matrix_init_drivers eeconfig is not enabled.\n");
- eeconfig_init();
- eeconfig_update_rgb_matrix_default();
- }
- rgb_matrix_config.raw = eeconfig_read_rgb_matrix();
- if (!rgb_matrix_config.mode) {
- dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n");
- eeconfig_update_rgb_matrix_default();
- rgb_matrix_config.raw = eeconfig_read_rgb_matrix();
- }
- eeconfig_debug_rgb_matrix(); // display current eeprom values
+void rgb_matrix_init(void) {
+ rgb_matrix_setup_drivers();
+
+ // TODO: put the 1 second startup delay here?
+
+ // clear the key hits
+ for ( int led=0; led<DRIVER_LED_TOTAL; led++ ) {
+ g_key_hit[led] = 255;
+ }
+
+
+ if (!eeconfig_is_enabled()) {
+ dprintf("rgb_matrix_init_drivers eeconfig is not enabled.\n");
+ eeconfig_init();
+ eeconfig_update_rgb_matrix_default();
+ }
+ rgb_matrix_config.raw = eeconfig_read_rgb_matrix();
+ if (!rgb_matrix_config.mode) {
+ dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n");
+ eeconfig_update_rgb_matrix_default();
+ rgb_matrix_config.raw = eeconfig_read_rgb_matrix();
+ }
+ eeconfig_debug_rgb_matrix(); // display current eeprom values
+}
+
+void rgb_matrix_setup_drivers(void) {
+ // Initialize TWI
+ i2c_init();
+ IS31FL3731_init( DRIVER_ADDR_1 );
+ IS31FL3731_init( DRIVER_ADDR_2 );
+
+ for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) {
+ bool enabled = true;
+ // This only caches it for later
+ IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
+ }
+ // This actually updates the LED drivers
+ IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );