Skip to content

Commit

Permalink
[Split] fix split_common i2c backlight disabling (qmk#3886)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rclasen authored and drashna committed May 7, 2019
1 parent 25c95ae commit 09b2b53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions quantum/split_common/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#ifdef BACKLIGHT_ENABLE
# include "backlight.h"
extern backlight_config_t backlight_config;
#endif

#ifdef ENCODER_ENABLE
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 09b2b53

Please sign in to comment.