diff options
-rw-r--r-- | quantum/api.c | 2 | ||||
-rw-r--r-- | quantum/rgblight.c | 7 | ||||
-rw-r--r-- | quantum/rgblight.h | 1 | ||||
-rw-r--r-- | quantum/split_common/transport.c | 12 |
4 files changed, 14 insertions, 8 deletions
diff --git a/quantum/api.c b/quantum/api.c index 52dfe23e1..233f99636 100644 --- a/quantum/api.c +++ b/quantum/api.c | |||
@@ -67,7 +67,7 @@ void process_api(uint16_t length, uint8_t * data) { | |||
67 | case DT_RGBLIGHT: { | 67 | case DT_RGBLIGHT: { |
68 | #ifdef RGBLIGHT_ENABLE | 68 | #ifdef RGBLIGHT_ENABLE |
69 | uint32_t rgblight = bytes_to_dword(data, 2); | 69 | uint32_t rgblight = bytes_to_dword(data, 2); |
70 | rgblight_update_dword(rgblight); | 70 | eeconfig_update_rgblight(rgblight); |
71 | #endif | 71 | #endif |
72 | break; | 72 | break; |
73 | } | 73 | } |
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 52e0be8ba..119ca1b9e 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
@@ -225,11 +225,14 @@ void rgblight_init(void) { | |||
225 | 225 | ||
226 | } | 226 | } |
227 | 227 | ||
228 | uint32_t rgblight_read_dword(void) { | ||
229 | return rgblight_config.raw; | ||
230 | } | ||
231 | |||
228 | void rgblight_update_dword(uint32_t dword) { | 232 | void rgblight_update_dword(uint32_t dword) { |
229 | rgblight_config.raw = dword; | 233 | rgblight_config.raw = dword; |
230 | eeconfig_update_rgblight(rgblight_config.raw); | ||
231 | if (rgblight_config.enable) | 234 | if (rgblight_config.enable) |
232 | rgblight_mode(rgblight_config.mode); | 235 | rgblight_mode_noeeprom(rgblight_config.mode); |
233 | else { | 236 | else { |
234 | #ifdef RGBLIGHT_USE_TIMER | 237 | #ifdef RGBLIGHT_USE_TIMER |
235 | rgblight_timer_disable(); | 238 | rgblight_timer_disable(); |
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index f92388c96..36e436b89 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
@@ -174,6 +174,7 @@ void rgblight_step_reverse(void); | |||
174 | uint8_t rgblight_get_mode(void); | 174 | uint8_t rgblight_get_mode(void); |
175 | void rgblight_mode(uint8_t mode); | 175 | void rgblight_mode(uint8_t mode); |
176 | void rgblight_set(void); | 176 | void rgblight_set(void); |
177 | uint32_t rgblight_read_dword(void); | ||
177 | void rgblight_update_dword(uint32_t dword); | 178 | void rgblight_update_dword(uint32_t dword); |
178 | void rgblight_increase_hue(void); | 179 | void rgblight_increase_hue(void); |
179 | void rgblight_decrease_hue(void); | 180 | void rgblight_decrease_hue(void); |
diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index b16852bc1..3696a2aba 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c | |||
@@ -39,17 +39,19 @@ bool transport_master(matrix_row_t matrix[]) { | |||
39 | static uint8_t prev_level = ~0; | 39 | static uint8_t prev_level = ~0; |
40 | uint8_t level = get_backlight_level(); | 40 | uint8_t level = get_backlight_level(); |
41 | if (level != prev_level) { | 41 | if (level != prev_level) { |
42 | i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIT_START, (void *)&level, sizeof(level), TIMEOUT); | 42 | if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) { |
43 | prev_level = level; | 43 | prev_level = level; |
44 | } | ||
44 | } | 45 | } |
45 | # endif | 46 | # endif |
46 | 47 | ||
47 | # ifdef RGBLIGHT_ENABLE | 48 | # ifdef RGBLIGHT_ENABLE |
48 | static uint32_t prev_rgb = ~0; | 49 | static uint32_t prev_rgb = ~0; |
49 | uint32_t rgb = eeconfig_read_rgblight(); | 50 | uint32_t rgb = rgblight_read_dword(); |
50 | if (rgb != prev_rgb) { | 51 | if (rgb != prev_rgb) { |
51 | i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_START, (void *)&rgb, sizeof(rgb), TIMEOUT); | 52 | if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_START, (void *)&rgb, sizeof(rgb), TIMEOUT) >= 0) { |
52 | prev_rgb = rgb; | 53 | prev_rgb = rgb; |
54 | } | ||
53 | } | 55 | } |
54 | # endif | 56 | # endif |
55 | 57 | ||