X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=quantum%2Frgb_matrix.c;h=874573bb2496916327c123efbc21843488cc6813;hb=7a44ad83fce391c938d18abcc2125e15c1982078;hp=992ce99de986f1b32421423b9c3552019197ee16;hpb=a98a91cf1b923107e9f26df316c1ef2192ff14f7;p=qmk_firmware.git diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 992ce99de..874573bb2 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -101,7 +101,6 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t } } - void rgb_matrix_update_pwm_buffers(void) { IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); @@ -115,7 +114,6 @@ void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { IS31FL3731_set_color_all( red, green, blue ); } - bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { if ( record->event.pressed ) { uint8_t led[8], led_count; @@ -149,8 +147,9 @@ void rgb_matrix_set_suspend_state(bool state) { void rgb_matrix_test(void) { // Mask out bits 4 and 5 - // This 2-bit value will stay the same for 16 ticks. - switch ( (g_tick & 0x30) >> 4 ) + // Increase the factor to make the test animation slower (and reduce to make it faster) + uint8_t factor = 10; + switch ( (g_tick & (0b11 << factor)) >> factor ) { case 0: { @@ -217,7 +216,7 @@ void rgb_matrix_single_LED_test(void) { } // All LEDs off -void rgb_matrix_all_off(void) { +void rgb_matrix_all_off(void) { rgb_matrix_set_color_all( 0, 0, 0 ); } @@ -243,7 +242,7 @@ void rgb_matrix_solid_reactive(void) { // alphas = color1, mods = color2 void rgb_matrix_alphas_mods(void) { - + RGB rgb1 = hsv_to_rgb( (HSV){ .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val } ); RGB rgb2 = hsv_to_rgb( (HSV){ .h = (rgb_matrix_config.hue + 180) % 360, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val } ); @@ -721,40 +720,44 @@ void rgb_matrix_indicators_user(void) {} // } // } -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