diff options
author | QMK Bot <hello@qmk.fm> | 2020-12-06 06:18:31 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2020-12-06 06:18:31 +0000 |
commit | 7043561459942c7cba8fef8547145196a8d03398 (patch) | |
tree | febe0ac2417abf3ddd55f8d4a8c4766a9f7a9ff1 /drivers | |
parent | e199fb619081dddaf76f203b77660f9ba41a30bd (diff) | |
parent | 6b1f96dca8b1218c0e3de6ef23dbde107f8c4588 (diff) | |
download | qmk_firmware-7043561459942c7cba8fef8547145196a8d03398.tar.gz qmk_firmware-7043561459942c7cba8fef8547145196a8d03398.zip |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/issi/is31fl3731-simple.c | 17 |
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; } } |