summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2020-12-06 06:18:02 +0000
committerDrashna Jael're <drashna@live.com>2021-01-12 22:46:07 -0800
commitf01e9becdfb8f3a17f0f061e3f9f521d83ec62a5 (patch)
treee11a53f0ccb7faa75771a296cfd162889526908f
parent99d80b2acb71cf23e957bad9c25017befa6d8537 (diff)
Update is31fl3731-simple (#7610)
* update simple * Update is31fl3731-simple.c
-rw-r--r--drivers/issi/is31fl3731-simple.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/issi/is31fl3731-simple.c b/drivers/issi/is31fl3731-simple.c
index bd3bb47460..cffb4d87ff 100644
--- a/drivers/issi/is31fl3731-simple.c
+++ b/drivers/issi/is31fl3731-simple.c
@@ -63,7 +63,7 @@ uint8_t g_twi_transfer_buffer[20];
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
// probably not worth the extra complexity.
uint8_t g_pwm_buffer[LED_DRIVER_COUNT][144];
-bool g_pwm_buffer_update_required = false;
+bool g_pwm_buffer_update_required[LED_DRIVER_COUNT] = {false};
/* There's probably a better way to init this... */
#if LED_DRIVER_COUNT == 1
@@ -75,7 +75,7 @@ uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}};
#elif LED_DRIVER_COUNT == 4
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}, {0}};
#endif
-bool g_led_control_registers_update_required = false;
+bool g_led_control_registers_update_required[LED_DRIVER_COUNT] = {false};
// This is the bit pattern in the LED control registers
// (for matrix A, add one to register for matrix B)
@@ -190,8 +190,8 @@ void IS31FL3731_set_value(int index, uint8_t value) {
is31_led led = g_is31_leds[index];
// Subtract 0x24 to get the second index of g_pwm_buffer
- g_pwm_buffer[led.driver][led.v - 0x24] = value;
- g_pwm_buffer_update_required = true;
+ g_pwm_buffer[led.driver][led.v - 0x24] = value;
+ g_pwm_buffer_update_required[led.driver] = true;
}
}
@@ -213,20 +213,21 @@ void IS31FL3731_set_led_control_register(uint8_t index, bool value) {
g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value);
}
- g_led_control_registers_update_required = true;
+ g_led_control_registers_update_required[led.driver] = true;
}
void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
- if (g_pwm_buffer_update_required) {
+ if (g_pwm_buffer_update_required[index]) {
IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
- g_pwm_buffer_update_required = false;
+ g_pwm_buffer_update_required[index] = false;
}
}
void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) {
- if (g_led_control_registers_update_required) {
+ if (g_led_control_registers_update_required[index]) {
for (int i = 0; i < 18; i++) {
IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]);
}
+ g_led_control_registers_update_required[index] = false;
}
}