[Split] fix split_common i2c backlight disabling (#3886)
slave backlight was always on - as get_backlight_level() doesn't indicate if the backlight is enabled or not. also updated the corosponding code for serial transport to stop peeking directly at 'internal' backlight_config structure.
This commit is contained in:
committed by
Drashna Jaelre
parent
ff3e430970
commit
5d9a4c4414
@@ -16,3 +16,4 @@
|
||||
05-05-2019 - New keycode macro (XP) for shifted character pairs using UNICODEMAP, and bugfixes/improvements
|
||||
05-05-2019 - Add `LINK_TIME_OPTIMIZATION_ENABLE` to enable LTO and disable problematic features that cause LTO to fail
|
||||
05-05-2019 - Fix issue with Space Cadet
|
||||
05-10-2019 - Split Common i2c Backlight fix
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
# include "backlight.h"
|
||||
extern backlight_config_t backlight_config;
|
||||
#endif
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
@@ -55,7 +54,7 @@ bool transport_master(matrix_row_t matrix[]) {
|
||||
|
||||
// write backlight info
|
||||
# ifdef BACKLIGHT_ENABLE
|
||||
uint8_t level = get_backlight_level();
|
||||
uint8_t level = is_backlight_enabled() ? get_backlight_level() : 0;
|
||||
if (level != i2c_buffer->backlight_level) {
|
||||
if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIGHT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) {
|
||||
i2c_buffer->backlight_level = level;
|
||||
@@ -223,7 +222,7 @@ bool transport_master(matrix_row_t matrix[]) {
|
||||
|
||||
# ifdef BACKLIGHT_ENABLE
|
||||
// Write backlight level for slave to read
|
||||
serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0;
|
||||
serial_m2s_buffer.backlight_level = is_backlight_enabled() ? get_backlight_level() : 0;
|
||||
# endif
|
||||
|
||||
# ifdef ENCODER_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user