summaryrefslogtreecommitdiffstats
path: root/drivers/led/issi/is31flcommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/led/issi/is31flcommon.c')
-rw-r--r--drivers/led/issi/is31flcommon.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/led/issi/is31flcommon.c b/drivers/led/issi/is31flcommon.c
index 9f4b2123ff..106890a8bf 100644
--- a/drivers/led/issi/is31flcommon.c
+++ b/drivers/led/issi/is31flcommon.c
@@ -135,14 +135,17 @@ void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index) {
void IS31FL_set_manual_scaling_buffer(void) {
for (int i = 0; i < ISSI_MANUAL_SCALING; i++) {
is31_led scale = g_is31_scaling[i];
- if (scale.driver >= 0 && scale.driver < DRIVER_LED_TOTAL) {
+# ifdef RGB_MATRIX_ENABLE
+ if (scale.driver >= 0 && scale.driver < RGB_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[scale.driver];
-# ifdef RGB_MATRIX_ENABLE
g_scaling_buffer[led.driver][led.r] = scale.r;
g_scaling_buffer[led.driver][led.g] = scale.g;
g_scaling_buffer[led.driver][led.b] = scale.b;
# elif defined(LED_MATRIX_ENABLE)
+ if (scale.driver >= 0 && scale.driver < LED_MATRIX_LED_COUNT) {
+ is31_led led = g_is31_leds[scale.driver];
+
g_scaling_buffer[led.driver][led.v] = scale.v;
# endif
g_scaling_buffer_update_required[led.driver] = true;
@@ -165,7 +168,7 @@ void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index) {
#ifdef RGB_MATRIX_ENABLE
// Colour is set by adjusting PWM register
void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
- if (index >= 0 && index < DRIVER_LED_TOTAL) {
+ if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[index];
g_pwm_buffer[led.driver][led.r] = red;
@@ -176,7 +179,7 @@ void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
}
void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
IS31FL_RGB_set_color(i, red, green, blue);
}
}
@@ -215,7 +218,7 @@ void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value) {
}
void IS31FL_simple_set_brightness(int index, uint8_t value) {
- if (index >= 0 && index < DRIVER_LED_TOTAL) {
+ if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
is31_led led = g_is31_leds[index];
g_pwm_buffer[led.driver][led.v] = value;
g_pwm_buffer_update_required[led.driver] = true;
@@ -223,7 +226,7 @@ void IS31FL_simple_set_brightness(int index, uint8_t value) {
}
void IS31FL_simple_set_brigntness_all(uint8_t value) {
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ for (int i = 0; i < LED_MATRIX_LED_COUNT; i++) {
IS31FL_simple_set_brightness(i, value);
}
}