diff options
author | QMK Bot <hello@qmk.fm> | 2021-09-15 17:07:47 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-09-15 17:07:47 +0000 |
commit | bf23e4647b8708187c6580d12acc8e08a9362ecc (patch) | |
tree | 695fd03e8c2c541c1883022385435575dc5a261f /drivers/led/issi | |
parent | 83988597f4d916a37b2b0987f393ceaa007532eb (diff) | |
parent | 169d5bd21d9381843914b4c23cbca1b447e905c6 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'drivers/led/issi')
-rw-r--r-- | drivers/led/issi/is31fl3741.c | 20 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3741.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/led/issi/is31fl3741.c b/drivers/led/issi/is31fl3741.c index 1b533c9b6a..24a273514e 100644 --- a/drivers/led/issi/is31fl3741.c +++ b/drivers/led/issi/is31fl3741.c @@ -73,7 +73,7 @@ uint8_t g_twi_transfer_buffer[20] = {0xFF}; // buffers and the transfers in IS31FL3741_write_pwm_buffer() but it's // probably not worth the extra complexity. uint8_t g_pwm_buffer[DRIVER_COUNT][ISSI_MAX_LEDS]; -bool g_pwm_buffer_update_required = false; +bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; bool g_scaling_registers_update_required[DRIVER_COUNT] = {false}; uint8_t g_scaling_registers[DRIVER_COUNT][ISSI_MAX_LEDS]; @@ -169,10 +169,10 @@ void IS31FL3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { if (index >= 0 && index < DRIVER_LED_TOTAL) { is31_led led = g_is31_leds[index]; - g_pwm_buffer[led.driver][led.r] = red; - g_pwm_buffer[led.driver][led.g] = green; - g_pwm_buffer[led.driver][led.b] = blue; - g_pwm_buffer_update_required = true; + g_pwm_buffer[led.driver][led.r] = red; + g_pwm_buffer[led.driver][led.g] = green; + g_pwm_buffer[led.driver][led.b] = blue; + g_pwm_buffer_update_required[led.driver] = true; } } @@ -206,12 +206,12 @@ void IS31FL3741_set_led_control_register(uint8_t index, bool red, bool green, bo g_scaling_registers_update_required[led.driver] = true; } -void IS31FL3741_update_pwm_buffers(uint8_t addr1, uint8_t addr2) { - if (g_pwm_buffer_update_required) { - IS31FL3741_write_pwm_buffer(addr1, g_pwm_buffer[0]); +void IS31FL3741_update_pwm_buffers(uint8_t addr, uint8_t index) { + if (g_pwm_buffer_update_required[index]) { + IS31FL3741_write_pwm_buffer(addr, g_pwm_buffer[index]); } - g_pwm_buffer_update_required = false; + g_pwm_buffer_update_required[index] = false; } void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue) { @@ -219,7 +219,7 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, g_pwm_buffer[pled->driver][pled->g] = green; g_pwm_buffer[pled->driver][pled->b] = blue; - g_pwm_buffer_update_required = true; + g_pwm_buffer_update_required[pled->driver] = true; } void IS31FL3741_update_led_control_registers(uint8_t addr, uint8_t index) { diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index cea6761ca8..163a035233 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h @@ -45,8 +45,8 @@ void IS31FL3741_set_led_control_register(uint8_t index, bool red, bool green, bo // (eg. from a timer interrupt). // Call this while idle (in between matrix scans). // If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3741_update_pwm_buffers(uint8_t addr1, uint8_t addr2); -void IS31FL3741_update_led_control_registers(uint8_t addr1, uint8_t addr2); +void IS31FL3741_update_pwm_buffers(uint8_t addr, uint8_t index); +void IS31FL3741_update_led_control_registers(uint8_t addr, uint8_t index); void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); |