#define EECONFIG_RGB_MATRIX EECONFIG_RGBLIGHT
#endif
+#if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > 255
+ #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255
+#endif
+
bool g_suspend_state = false;
// Global tick at 20 Hz
rgb_matrix_config.mode = RGB_MATRIX_CYCLE_LEFT_RIGHT;
rgb_matrix_config.hue = 0;
rgb_matrix_config.sat = 255;
- rgb_matrix_config.val = 255;
+ rgb_matrix_config.val = RGB_MATRIX_MAXIMUM_BRIGHTNESS;
rgb_matrix_config.speed = 0;
eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
}
}
void rgb_matrix_update_pwm_buffers(void) {
- uint8_t ret = IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
- ret |= IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
- if (ret == 2) {
- wait_ms(1000);
- i2c_stop();
- rgb_matrix_setup_drivers();
- }
+ IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
+ IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
}
void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) {
}
void rgblight_increase_val(void) {
- rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, 255 );
+ rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS );
eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
}
void rgblight_decrease_val(void) {
- rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, 255 );
+ rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS );
eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
}