summaryrefslogtreecommitdiff
path: root/keyboards/iris
diff options
context:
space:
mode:
authorDanny <nooges@users.noreply.github.com>2018-05-22 15:40:43 -0400
committerDrashna Jaelre <drashna@live.com>2018-05-22 12:40:43 -0700
commit7658f10fba71974bdd6dfc33fbd53deff76b1f83 (patch)
treeaaa3ee07b4507942e67cfa49bf069a3aa50268dc /keyboards/iris
parent4b1f60a3f5ed223e34ae8381e57f600551ccf085 (diff)
Fix led enabled slave (#3022)
* Account for backlight enabled flag when passing backlight level to slave * Add BL_TOGG to keymap for testing * Apply backlight fix to Iris * Port I2C LED backlight control from Iris to Levinson
Diffstat (limited to 'keyboards/iris')
-rw-r--r--keyboards/iris/matrix.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/keyboards/iris/matrix.c b/keyboards/iris/matrix.c
index dcfc0216ea..7195fb0ead 100644
--- a/keyboards/iris/matrix.c
+++ b/keyboards/iris/matrix.c
@@ -30,7 +30,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "pro_micro.h"
#include "config.h"
#include "timer.h"
-#include "backlight.h"
+
+#ifdef BACKLIGHT_ENABLE
+ #include "backlight.h"
+ extern backlight_config_t backlight_config;
+#endif
#ifdef USE_I2C
# include "i2c.h"
@@ -86,7 +90,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
static void select_col(uint8_t col);
#endif
-
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
@@ -202,7 +205,7 @@ int i2c_transaction(void) {
#ifdef BACKLIGHT_ENABLE
// Write backlight level for slave to read
- err = i2c_master_write(get_backlight_level());
+ err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0);
#else
// Write zero, so our byte index is the same
err = i2c_master_write(0x00);
@@ -244,7 +247,7 @@ int serial_transaction(void) {
#ifdef BACKLIGHT_ENABLE
// Write backlight level for slave to read
- serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level();
+ serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0;
#endif
return 0;
}