aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/split_common/transport.c
diff options
context:
space:
mode:
authorGravatar Rainer Clasen <bj@zuto.de>2019-05-07 19:45:10 +0200
committerGravatar Drashna Jaelre <drashna@live.com>2019-05-07 10:45:10 -0700
commit12e6d412023b23c64980d30704ae11892e33c512 (patch)
tree9959b4ec0a37e5c3e5d54f4508af3b91afe66722 /quantum/split_common/transport.c
parent2d5c16dfd4ef193c4f692722157aa2b526a4c877 (diff)
downloadqmk_firmware-12e6d412023b23c64980d30704ae11892e33c512.tar.gz
[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.
Diffstat (limited to 'quantum/split_common/transport.c')
-rw-r--r--quantum/split_common/transport.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c
index 7ea1a9cec..a3539576f 100644
--- a/quantum/split_common/transport.c
+++ b/quantum/split_common/transport.c
@@ -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