Skip to content

Commit

Permalink
Merge remote-tracking branch 'XScorpion2/split_rgb_matrix_2020'
Browse files Browse the repository at this point in the history
* XScorpion2/split_rgb_matrix_2020:
  Split RGB Matrix
  Split transport mirror support
  [Split] Sync Timer feature (qmk#10997)
  Branch point for 2021 Feb 27 Breaking Change
  Configurable serial usart timeout (qmk#11057)
  • Loading branch information
nicsuzor committed Dec 16, 2020
2 parents 38d6b39 + bf43328 commit c84595c
Show file tree
Hide file tree
Showing 23 changed files with 317 additions and 87 deletions.
2 changes: 2 additions & 0 deletions docs/feature_rgb_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo
#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
#define RGB_MATRIX_DISABLE_KEYCODES // disables control of rgb matrix by keycodes (must use code functions to control the feature)
#define RGB_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right.
// If RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR
```

## EEPROM storage :id=eeprom-storage
Expand Down
6 changes: 6 additions & 0 deletions docs/feature_split_keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ If you're having issues with serial communication, you can change this value, as
* **`4`**: about 26kbps
* **`5`**: about 20kbps
```c
#define SPLIT_TRANSPORT_MIRROR
```
This mirrors the master side matrix to the slave side for features that react or require knowledge of master side key presses on the slave side.
### Hardware Configuration Options
There are some settings that you may need to configure, based on how the hardware is set up.
Expand Down
1 change: 0 additions & 1 deletion docs/ja/understanding_qmk.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* [`bool process_haptic(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/2cee371bf125a6ec541dd7c5a809573facc7c456/drivers/haptic/haptic.c#L216)
* [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/card.c#L20)
* [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/keymaps/default/keymap.c#L58)
* [`bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/rgb_matrix.c#L139)
* [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_midi.c#L81)
* [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_audio.c#L19)
* [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_steno.c#L160)
Expand Down
1 change: 1 addition & 0 deletions docs/serial_driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Configure the hardware via your config.h:
// 5: about 19200 baud
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
```
You must also enable the ChibiOS `SERIAL` feature:
Expand Down
1 change: 0 additions & 1 deletion docs/understanding_qmk.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ The `process_record()` function itself is deceptively simple, but hidden within
* [`bool process_haptic(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/2cee371bf125a6ec541dd7c5a809573facc7c456/drivers/haptic/haptic.c#L216)
* [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/card.c#L20)
* [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/keyboards/clueboard/card/keymaps/default/keymap.c#L58)
* [`bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/rgb_matrix.c#L139)
* [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_midi.c#L81)
* [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_audio.c#L19)
* [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_steno.c#L160)
Expand Down
13 changes: 8 additions & 5 deletions drivers/chibios/serial_usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
# error invalid SELECT_SOFT_SERIAL_SPEED value
#endif

#define TIMEOUT 100
#ifndef SERIAL_USART_TIMEOUT
# define SERIAL_USART_TIMEOUT 100
#endif

#define HANDSHAKE_MAGIC 7

static inline msg_t sdWriteHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size) {
Expand Down Expand Up @@ -201,29 +204,29 @@ int soft_serial_transaction(int index) {
sdClear(&SERIAL_USART_DRIVER);

// First chunk is always transaction id
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(TIMEOUT));
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(SERIAL_USART_TIMEOUT));

uint8_t sstd_index_shake = 0xFF;

// Which we always read back first so that we can error out correctly
// - due to the half duplex limitations on return codes, we always have to read *something*
// - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(TIMEOUT));
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(SERIAL_USART_TIMEOUT));
if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) {
dprintf("serial::usart_shake NO_RESPONSE\n");
return TRANSACTION_NO_RESPONSE;
}

if (trans->initiator2target_buffer_size) {
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(TIMEOUT));
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
if (res < 0) {
dprintf("serial::usart_transmit NO_RESPONSE\n");
return TRANSACTION_NO_RESPONSE;
}
}

if (trans->target2initiator_buffer_size) {
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(TIMEOUT));
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
if (res < 0) {
dprintf("serial::usart_receive NO_RESPONSE\n");
return TRANSACTION_NO_RESPONSE;
Expand Down
10 changes: 0 additions & 10 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ bool process_record_quantum(keyrecord_t *record) {
#ifdef HAPTIC_ENABLE
process_haptic(keycode, record) &&
#endif // HAPTIC_ENABLE
#if defined(RGB_MATRIX_ENABLE)
process_rgb_matrix(keycode, record) &&
#endif
#if defined(VIA_ENABLE)
process_record_via(keycode, record) &&
#endif
Expand Down Expand Up @@ -622,9 +619,6 @@ void matrix_init_quantum() {
#ifdef AUDIO_ENABLE
audio_init();
#endif
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_init();
#endif
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
unicode_input_mode_init();
#endif
Expand Down Expand Up @@ -659,10 +653,6 @@ void matrix_scan_quantum() {
led_matrix_task();
#endif

#ifdef RGB_MATRIX_ENABLE
rgb_matrix_task();
#endif

#ifdef WPM_ENABLE
decay_wpm();
#endif
Expand Down
1 change: 1 addition & 0 deletions quantum/quantum.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "eeconfig.h"
#include "bootloader.h"
#include "timer.h"
#include "sync_timer.h"
#include "config_common.h"
#include "led.h"
#include "action_util.h"
Expand Down
60 changes: 42 additions & 18 deletions quantum/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ last_hit_t g_last_hit_tracker;
// internals
static uint8_t rgb_last_enable = UINT8_MAX;
static uint8_t rgb_last_effect = UINT8_MAX;
static effect_params_t rgb_effect_params = {0, 0xFF};
static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false};
static rgb_task_states rgb_task_state = SYNCING;
#if RGB_DISABLE_TIMEOUT > 0
static uint32_t rgb_anykey_timer;
Expand All @@ -143,6 +143,11 @@ static uint32_t rgb_timer_buffer;
static last_hit_t last_hit_buffer;
#endif // RGB_MATRIX_KEYREACTIVE_ENABLED

// split rgb matrix
#ifdef RGB_MATRIX_SPLIT
const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT;
#endif

void eeconfig_read_rgb_matrix(void) { eeprom_read_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); }

void eeconfig_update_rgb_matrix(void) { eeprom_update_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); }
Expand All @@ -153,6 +158,7 @@ void eeconfig_update_rgb_matrix_default(void) {
rgb_matrix_config.mode = RGB_MATRIX_STARTUP_MODE;
rgb_matrix_config.hsv = (HSV){RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL};
rgb_matrix_config.speed = RGB_MATRIX_STARTUP_SPD;
rgb_matrix_config.flags = LED_FLAG_ALL;
eeconfig_update_rgb_matrix();
}

Expand All @@ -164,6 +170,7 @@ void eeconfig_debug_rgb_matrix(void) {
dprintf("rgb_matrix_config.hsv.s = %d\n", rgb_matrix_config.hsv.s);
dprintf("rgb_matrix_config.hsv.v = %d\n", rgb_matrix_config.hsv.v);
dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed);
dprintf("rgb_matrix_config.flags = %d\n", rgb_matrix_config.flags);
}

__attribute__((weak)) uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { return 0; }
Expand All @@ -180,28 +187,43 @@ uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *l

void rgb_matrix_update_pwm_buffers(void) { rgb_matrix_driver.flush(); }

void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_driver.set_color(index, red, green, blue); }
void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
#ifdef RGB_MATRIX_SPLIT
if (!is_keyboard_left() && index >= k_rgb_matrix_split[0])
rgb_matrix_driver.set_color(index - k_rgb_matrix_split[0], red, green, blue);
else if (is_keyboard_left() && index < k_rgb_matrix_split[0])
#endif
rgb_matrix_driver.set_color(index, red, green, blue);
}

void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_driver.set_color_all(red, green, blue); }
void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
#ifdef RGB_MATRIX_SPLIT
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++)
rgb_matrix_set_color(i, red, green, blue);
#else
rgb_matrix_driver.set_color_all(red, green, blue);
#endif
}

bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) {
#ifndef RGB_MATRIX_SPLIT
if (!is_keyboard_master()) return;
#endif
#if RGB_DISABLE_TIMEOUT > 0
if (record->event.pressed) {
rgb_anykey_timer = 0;
}
rgb_anykey_timer = 0;
#endif // RGB_DISABLE_TIMEOUT > 0

#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
uint8_t led[LED_HITS_TO_REMEMBER];
uint8_t led_count = 0;

# if defined(RGB_MATRIX_KEYRELEASES)
if (!record->event.pressed)
if (!pressed)
# elif defined(RGB_MATRIX_KEYPRESSES)
if (record->event.pressed)
if (pressed)
# endif // defined(RGB_MATRIX_KEYRELEASES)
{
led_count = rgb_matrix_map_row_column_to_led(record->event.key.row, record->event.key.col, led);
led_count = rgb_matrix_map_row_column_to_led(row, col, led);
}

if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) {
Expand All @@ -224,11 +246,9 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {

#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP)
if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) {
process_rgb_matrix_typing_heatmap(record);
process_rgb_matrix_typing_heatmap(row, col);
}
#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP)

return true;
}

void rgb_matrix_test(void) {
Expand Down Expand Up @@ -266,9 +286,9 @@ static bool rgb_matrix_none(effect_params_t *params) {

static void rgb_task_timers(void) {
#if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0
uint32_t deltaTime = timer_elapsed32(rgb_timer_buffer);
uint32_t deltaTime = sync_timer_elapsed32(rgb_timer_buffer);
#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0
rgb_timer_buffer = timer_read32();
rgb_timer_buffer = sync_timer_read32();

// Update double buffer timers
#if RGB_DISABLE_TIMEOUT > 0
Expand Down Expand Up @@ -296,7 +316,7 @@ static void rgb_task_timers(void) {

static void rgb_task_sync(void) {
// next task
if (timer_elapsed32(g_rgb_timer) >= RGB_MATRIX_LED_FLUSH_LIMIT) rgb_task_state = STARTING;
if (sync_timer_elapsed32(g_rgb_timer) >= RGB_MATRIX_LED_FLUSH_LIMIT) rgb_task_state = STARTING;
}

static void rgb_task_start(void) {
Expand All @@ -316,6 +336,10 @@ static void rgb_task_start(void) {
static void rgb_task_render(uint8_t effect) {
bool rendering = false;
rgb_effect_params.init = (effect != rgb_last_effect) || (rgb_matrix_config.enable != rgb_last_enable);
if (rgb_effect_params.flags != rgb_matrix_config.flags) {
rgb_effect_params.flags = rgb_matrix_config.flags;
rgb_matrix_set_color_all(0, 0, 0);
}

// each effect can opt to do calculations
// and/or request PWM buffer updates.
Expand Down Expand Up @@ -619,6 +643,6 @@ void rgb_matrix_decrease_speed_helper(bool write_to_eeprom) { rgb_matrix_set_spe
void rgb_matrix_decrease_speed_noeeprom(void) { rgb_matrix_decrease_speed_helper(false); }
void rgb_matrix_decrease_speed(void) { rgb_matrix_decrease_speed_helper(true); }

led_flags_t rgb_matrix_get_flags(void) { return rgb_effect_params.flags; }
led_flags_t rgb_matrix_get_flags(void) { return rgb_matrix_config.flags; }

void rgb_matrix_set_flags(led_flags_t flags) { rgb_effect_params.flags = flags; }
void rgb_matrix_set_flags(led_flags_t flags) { rgb_matrix_config.flags = flags; }
2 changes: 1 addition & 1 deletion quantum/rgb_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *l
void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record);
void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed);

void rgb_matrix_task(void);

Expand Down
4 changes: 1 addition & 3 deletions quantum/rgb_matrix_animations/typing_heatmap_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
RGB_MATRIX_EFFECT(TYPING_HEATMAP)
# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

void process_rgb_matrix_typing_heatmap(keyrecord_t* record) {
uint8_t row = record->event.key.row;
uint8_t col = record->event.key.col;
void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
uint8_t m_row = row - 1;
uint8_t p_row = row + 1;
uint8_t m_col = col - 1;
Expand Down
1 change: 1 addition & 0 deletions quantum/rgb_matrix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ typedef union {
uint8_t mode : 6;
HSV hsv;
uint8_t speed; // EECONFIG needs to be increased to support this
led_flags_t flags;
};
} rgb_config_t;

Expand Down
21 changes: 10 additions & 11 deletions quantum/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#endif
#include "wait.h"
#include "progmem.h"
#include "timer.h"
#include "sync_timer.h"
#include "rgblight.h"
#include "color.h"
#include "debug.h"
Expand Down Expand Up @@ -684,18 +684,16 @@ static void rgblight_layers_write(void) {

# ifdef RGBLIGHT_LAYER_BLINK
rgblight_layer_mask_t _blinked_layer_mask = 0;
uint16_t _blink_duration = 0;
static uint16_t _blink_timer;

void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) {
rgblight_set_layer_state(layer, true);
_blinked_layer_mask |= 1 << layer;
_blink_timer = timer_read();
_blink_duration = duration_ms;
_blink_timer = sync_timer_read() + duration_ms;
}

void rgblight_unblink_layers(void) {
if (_blinked_layer_mask != 0 && timer_elapsed(_blink_timer) > _blink_duration) {
if (_blinked_layer_mask != 0 && timer_expired(sync_timer_read(), _blink_timer)) {
for (uint8_t layer = 0; layer < RGBLIGHT_MAX_LAYERS; layer++) {
if ((_blinked_layer_mask & 1 << layer) != 0) {
rgblight_set_layer_state(layer, false);
Expand Down Expand Up @@ -799,7 +797,7 @@ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) {
animation_status.restart = true;
}
# endif /* RGBLIGHT_SPLIT_NO_ANIMATION_SYNC */
# endif /* RGBLIGHT_USE_TIMER */
# endif /* RGBLIGHT_USE_TIMER */
}
#endif /* RGBLIGHT_SPLIT */

Expand Down Expand Up @@ -832,7 +830,7 @@ void rgblight_timer_enable(void) {
if (!is_static_effect(rgblight_config.mode)) {
rgblight_status.timer_enabled = true;
}
animation_status.last_timer = timer_read();
animation_status.last_timer = sync_timer_read();
RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE;
dprintf("rgblight timer enabled.\n");
}
Expand Down Expand Up @@ -941,18 +939,19 @@ void rgblight_task(void) {
# endif
if (animation_status.restart) {
animation_status.restart = false;
animation_status.last_timer = timer_read() - interval_time - 1;
animation_status.last_timer = sync_timer_read();
animation_status.pos16 = 0; // restart signal to local each effect
}
if (timer_elapsed(animation_status.last_timer) >= interval_time) {
uint16_t now = sync_timer_read();
if (timer_expired(now, animation_status.last_timer)) {
# if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC)
static uint16_t report_last_timer = 0;
static bool tick_flag = false;
uint16_t oldpos16;
if (tick_flag) {
tick_flag = false;
if (timer_elapsed(report_last_timer) >= 30000) {
report_last_timer = timer_read();
if (timer_expired(now, report_last_timer)) {
report_last_timer += 30000;
dprintf("rgblight animation tick report to slave\n");
RGBLIGHT_SPLIT_ANIMATION_TICK;
}
Expand Down
4 changes: 2 additions & 2 deletions quantum/split_common/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void matrix_post_scan(void) {
if (is_keyboard_master()) {
static uint8_t error_count;

if (!transport_master(matrix + thatHand)) {
if (!transport_master(matrix + thisHand, matrix + thatHand)) {
error_count++;

if (error_count > ERROR_DISCONNECT_COUNT) {
Expand All @@ -274,7 +274,7 @@ void matrix_post_scan(void) {

matrix_scan_quantum();
} else {
transport_slave(matrix + thisHand);
transport_slave(matrix + thatHand, matrix + thisHand);

matrix_slave_scan_user();
}
Expand Down
Loading

0 comments on commit c84595c

Please sign in to comment.