diff options
| author | Chris Cullin <chris@miplace.com> | 2021-07-13 01:51:23 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-12 08:51:23 -0700 |
| commit | 9c74fd14bc9777ec45cc93fa57bf83ab17b988db (patch) | |
| tree | e82c74183f7413e303f6afa247bcd54a106bfc6f /drivers | |
| parent | 4706231831b7b5926052ee1affc7f38a165c7761 (diff) | |
| download | qmk_firmware-9c74fd14bc9777ec45cc93fa57bf83ab17b988db.tar.gz qmk_firmware-9c74fd14bc9777ec45cc93fa57bf83ab17b988db.zip | |
Enable g_is31_leds PROGMEM for RGB Matrix IS31FL3737 driver (#13480)
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/issi/is31fl3737.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/issi/is31fl3737.c b/drivers/issi/is31fl3737.c index 8647c93cc..e40bfa0d7 100644 --- a/drivers/issi/is31fl3737.c +++ b/drivers/issi/is31fl3737.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include "is31fl3737.h" | 19 | #include "is31fl3737.h" |
| 20 | #include "i2c_master.h" | 20 | #include "i2c_master.h" |
| 21 | #include "wait.h" | 21 | #include "wait.h" |
| 22 | #include "progmem.h" | ||
| 22 | 23 | ||
| 23 | // This is a 7-bit address, that gets left-shifted and bit 0 | 24 | // This is a 7-bit address, that gets left-shifted and bit 0 |
| 24 | // set to 0 for write, 1 for read (as per I2C protocol) | 25 | // set to 0 for write, 1 for read (as per I2C protocol) |
| @@ -153,7 +154,9 @@ void IS31FL3737_init(uint8_t addr) { | |||
| 153 | 154 | ||
| 154 | void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { | 155 | void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { |
| 155 | if (index >= 0 && index < DRIVER_LED_TOTAL) { | 156 | if (index >= 0 && index < DRIVER_LED_TOTAL) { |
| 156 | is31_led led = g_is31_leds[index]; | 157 | // copy the led config from progmem to SRAM |
| 158 | is31_led led; | ||
| 159 | memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); | ||
| 157 | 160 | ||
| 158 | g_pwm_buffer[led.driver][led.r] = red; | 161 | g_pwm_buffer[led.driver][led.r] = red; |
| 159 | g_pwm_buffer[led.driver][led.g] = green; | 162 | g_pwm_buffer[led.driver][led.g] = green; |
| @@ -169,7 +172,9 @@ void IS31FL3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { | |||
| 169 | } | 172 | } |
| 170 | 173 | ||
| 171 | void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { | 174 | void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { |
| 172 | is31_led led = g_is31_leds[index]; | 175 | // copy the led config from progmem to SRAM |
| 176 | is31_led led; | ||
| 177 | memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); | ||
| 173 | 178 | ||
| 174 | uint8_t control_register_r = led.r / 8; | 179 | uint8_t control_register_r = led.r / 8; |
| 175 | uint8_t control_register_g = led.g / 8; | 180 | uint8_t control_register_g = led.g / 8; |
