summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-06-10 22:01:46 -0700
committerGitHub <noreply@github.com>2022-06-10 22:01:46 -0700
commit80034a847fdfe91cf0d6ef9399d34d90c15d8a54 (patch)
treee6307d5280e4319dd00a9d748cdb6af47c158cf1
parent568924c76cb29620e2cb7d2f2f5b1beddf8cf623 (diff)
Ensure that rgb+via compiles in all cases (#17355)
-rw-r--r--quantum/via.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/quantum/via.c b/quantum/via.c
index 1ded1f5fe8..d2ef0862cc 100644
--- a/quantum/via.c
+++ b/quantum/via.c
@@ -461,6 +461,9 @@ void via_qmk_backlight_set_value(uint8_t *data) {
#endif // #if defined(VIA_QMK_BACKLIGHT_ENABLE)
#if defined(VIA_QMK_RGBLIGHT_ENABLE)
+# ifndef RGBLIGHT_LIMIT_VAL
+# define RGBLIGHT_LIMIT_VAL 255
+# endif
void via_qmk_rgblight_get_value(uint8_t *data) {
uint8_t *value_id = &(data[0]);
@@ -518,6 +521,11 @@ void via_qmk_rgblight_set_value(uint8_t *data) {
#if defined(VIA_QMK_RGB_MATRIX_ENABLE)
+# if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX
+# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
+# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX
+# endif
+
// VIA supports only 4 discrete values for effect speed; map these to some
// useful speed values for RGB Matrix.
enum speed_values {