aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c
index 874573bb2..b4bbc3dc0 100644
--- a/quantum/rgb_matrix.c
+++ b/quantum/rgb_matrix.c
@@ -41,6 +41,10 @@ rgb_config_t rgb_matrix_config;
41 #define EECONFIG_RGB_MATRIX EECONFIG_RGBLIGHT 41 #define EECONFIG_RGB_MATRIX EECONFIG_RGBLIGHT
42#endif 42#endif
43 43
44#if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > 255
45 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255
46#endif
47
44bool g_suspend_state = false; 48bool g_suspend_state = false;
45 49
46// Global tick at 20 Hz 50// Global tick at 20 Hz
@@ -68,7 +72,7 @@ void eeconfig_update_rgb_matrix_default(void) {
68 rgb_matrix_config.mode = RGB_MATRIX_CYCLE_LEFT_RIGHT; 72 rgb_matrix_config.mode = RGB_MATRIX_CYCLE_LEFT_RIGHT;
69 rgb_matrix_config.hue = 0; 73 rgb_matrix_config.hue = 0;
70 rgb_matrix_config.sat = 255; 74 rgb_matrix_config.sat = 255;
71 rgb_matrix_config.val = 255; 75 rgb_matrix_config.val = RGB_MATRIX_MAXIMUM_BRIGHTNESS;
72 rgb_matrix_config.speed = 0; 76 rgb_matrix_config.speed = 0;
73 eeconfig_update_rgb_matrix(rgb_matrix_config.raw); 77 eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
74} 78}
@@ -860,12 +864,12 @@ void rgblight_decrease_sat(void) {
860} 864}
861 865
862void rgblight_increase_val(void) { 866void rgblight_increase_val(void) {
863 rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, 255 ); 867 rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS );
864 eeconfig_update_rgb_matrix(rgb_matrix_config.raw); 868 eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
865} 869}
866 870
867void rgblight_decrease_val(void) { 871void rgblight_decrease_val(void) {
868 rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, 255 ); 872 rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS );
869 eeconfig_update_rgb_matrix(rgb_matrix_config.raw); 873 eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
870} 874}
871 875