diff options
Diffstat (limited to 'drivers/led/issi/is31fl3737.c')
-rw-r--r-- | drivers/led/issi/is31fl3737.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/led/issi/is31fl3737.c b/drivers/led/issi/is31fl3737.c index 30906b484..0bb4ddd42 100644 --- a/drivers/led/issi/is31fl3737.c +++ b/drivers/led/issi/is31fl3737.c | |||
@@ -19,7 +19,6 @@ | |||
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" | ||
23 | 22 | ||
24 | // This is a 7-bit address, that gets left-shifted and bit 0 | 23 | // This is a 7-bit address, that gets left-shifted and bit 0 |
25 | // set to 0 for write, 1 for read (as per I2C protocol) | 24 | // set to 0 for write, 1 for read (as per I2C protocol) |
@@ -155,9 +154,7 @@ void IS31FL3737_init(uint8_t addr) { | |||
155 | 154 | ||
156 | 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) { |
157 | if (index >= 0 && index < DRIVER_LED_TOTAL) { | 156 | if (index >= 0 && index < DRIVER_LED_TOTAL) { |
158 | // copy the led config from progmem to SRAM | 157 | is31_led led = g_is31_leds[index]; |
159 | is31_led led; | ||
160 | memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); | ||
161 | 158 | ||
162 | g_pwm_buffer[led.driver][led.r] = red; | 159 | g_pwm_buffer[led.driver][led.r] = red; |
163 | g_pwm_buffer[led.driver][led.g] = green; | 160 | g_pwm_buffer[led.driver][led.g] = green; |
@@ -173,9 +170,7 @@ void IS31FL3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { | |||
173 | } | 170 | } |
174 | 171 | ||
175 | void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { | 172 | void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { |
176 | // copy the led config from progmem to SRAM | 173 | is31_led led = g_is31_leds[index]; |
177 | is31_led led; | ||
178 | memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); | ||
179 | 174 | ||
180 | uint8_t control_register_r = led.r / 8; | 175 | uint8_t control_register_r = led.r / 8; |
181 | uint8_t control_register_g = led.g / 8; | 176 | uint8_t control_register_g = led.g / 8; |