X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=keyboards%2Firis%2Fmatrix.c;h=dcfc0216eac2b93c75326d37dd1baf9fce9f1a54;hb=6ba73e0e04315b3286ba00f6a2f4954ae045588d;hp=b83311ce16b0f5ce591224ef1c1abddcbaf9fc59;hpb=b5464cf20aa21bfe3671bd584dfc727878d508e0;p=qmk_firmware.git diff --git a/keyboards/iris/matrix.c b/keyboards/iris/matrix.c index b83311ce1..dcfc0216e 100644 --- a/keyboards/iris/matrix.c +++ b/keyboards/iris/matrix.c @@ -85,15 +85,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { @@ -208,6 +200,15 @@ int i2c_transaction(void) { err = i2c_master_write(0x00); if (err) goto i2c_error; +#ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + err = i2c_master_write(get_backlight_level()); +#else + // Write zero, so our byte index is the same + err = i2c_master_write(0x00); +#endif + if (err) goto i2c_error; + // Start read err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; @@ -285,8 +286,12 @@ void matrix_slave_scan(void) { int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_I2C +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(i2c_slave_buffer[0]); +#endif for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; + i2c_slave_buffer[i+1] = matrix[offset+i]; } #else // USE_SERIAL for (int i = 0; i < ROWS_PER_HAND; ++i) {