summaryrefslogtreecommitdiffstats
path: root/drivers/led/issi/is31fl3733-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/led/issi/is31fl3733-simple.c')
-rw-r--r--drivers/led/issi/is31fl3733-simple.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/led/issi/is31fl3733-simple.c b/drivers/led/issi/is31fl3733-simple.c
index 21138c6e05..d90fd8587f 100644
--- a/drivers/led/issi/is31fl3733-simple.c
+++ b/drivers/led/issi/is31fl3733-simple.c
@@ -193,9 +193,13 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) {
}
void IS31FL3733_set_value(int index, uint8_t value) {
+ is31_led led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
- is31_led led = g_is31_leds[index];
+ memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
+ if (g_pwm_buffer[led.driver][led.v] == value) {
+ return;
+ }
g_pwm_buffer[led.driver][led.v] = value;
g_pwm_buffer_update_required[led.driver] = true;
}
@@ -208,7 +212,8 @@ void IS31FL3733_set_value_all(uint8_t value) {
}
void IS31FL3733_set_led_control_register(uint8_t index, bool value) {
- is31_led led = g_is31_leds[index];
+ is31_led led;
+ memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
uint8_t control_register = led.v / 8;
uint8_t bit_value = led.v % 8;