diff options
| -rw-r--r-- | docs/feature_rgb_matrix.md | 1 | ||||
| -rw-r--r-- | keyboards/hs60/config.h | 1 | ||||
| -rw-r--r-- | quantum/rgb_matrix.c | 10 |
3 files changed, 9 insertions, 3 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 5d2db3b97..cb7aa666c 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
| @@ -119,6 +119,7 @@ A similar function works in the keymap as `rgb_matrix_indicators_user`. | |||
| 119 | #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 119 | #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 120 | #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended | 120 | #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended |
| 121 | #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 | 121 | #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 |
| 122 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 | ||
| 122 | 123 | ||
| 123 | ## EEPROM storage | 124 | ## EEPROM storage |
| 124 | 125 | ||
diff --git a/keyboards/hs60/config.h b/keyboards/hs60/config.h index d37fc8990..31f7c0790 100644 --- a/keyboards/hs60/config.h +++ b/keyboards/hs60/config.h | |||
| @@ -127,6 +127,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 127 | #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 127 | #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 128 | #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended | 128 | #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended |
| 129 | #define RGB_MATRIX_SKIP_FRAMES 0 | 129 | #define RGB_MATRIX_SKIP_FRAMES 0 |
| 130 | #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 215 | ||
| 130 | 131 | ||
| 131 | #define DRIVER_ADDR_1 0b1110100 | 132 | #define DRIVER_ADDR_1 0b1110100 |
| 132 | #define DRIVER_ADDR_2 0b1110101 | 133 | #define DRIVER_ADDR_2 0b1110101 |
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 8c41fc54d..b7424d637 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 | |||
| 44 | bool g_suspend_state = false; | 48 | bool 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 | } |
| @@ -858,12 +862,12 @@ void rgblight_decrease_sat(void) { | |||
| 858 | } | 862 | } |
| 859 | 863 | ||
| 860 | void rgblight_increase_val(void) { | 864 | void rgblight_increase_val(void) { |
| 861 | rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, 255 ); | 865 | rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS ); |
| 862 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); | 866 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); |
| 863 | } | 867 | } |
| 864 | 868 | ||
| 865 | void rgblight_decrease_val(void) { | 869 | void rgblight_decrease_val(void) { |
| 866 | rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, 255 ); | 870 | rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS ); |
| 867 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); | 871 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); |
| 868 | } | 872 | } |
| 869 | 873 | ||
