1
0

Refactor core use of deprecated isLeftHand (#25888)

This commit is contained in:
Joel Challis
2025-12-21 20:52:55 +00:00
committed by GitHub
parent f82d4d8680
commit c1161a7a32
10 changed files with 33 additions and 10 deletions

View File

@@ -21,6 +21,7 @@
#include "dip_switch.h"
#ifdef SPLIT_KEYBOARD
# include "keyboard.h"
# include "split_common/split_util.h"
#endif
@@ -87,7 +88,7 @@ static void dip_switch_exec_mapping(uint8_t index, bool on) {
void dip_switch_init(void) {
#ifdef DIP_SWITCH_PINS
# if defined(SPLIT_KEYBOARD) && defined(DIP_SWITCH_PINS_RIGHT)
if (!isLeftHand) {
if (!is_keyboard_left()) {
const pin_t dip_switch_pad_right[] = DIP_SWITCH_PINS_RIGHT;
for (uint8_t i = 0; i < NUM_DIP_SWITCHES; i++) {
dip_switch_pad[i] = dip_switch_pad_right[i];

View File

@@ -41,6 +41,10 @@ bool is_keyboard_master(void) {
return isMaster;
}
bool is_keyboard_left(void) {
return isLeftHand;
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!is_keyboard_master()) {
// this method has no effect on slave half

View File

@@ -41,6 +41,10 @@ bool is_keyboard_master(void) {
return isMaster;
}
bool is_keyboard_left(void) {
return isLeftHand;
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!is_keyboard_master()) {
// this method has no effect on slave half

View File

@@ -41,6 +41,10 @@ bool is_keyboard_master(void) {
return isMaster;
}
bool is_keyboard_left(void) {
return isLeftHand;
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!is_keyboard_master()) {
// this method has no effect on slave half

View File

@@ -41,6 +41,10 @@ bool is_keyboard_master(void) {
return isMaster;
}
bool is_keyboard_left(void) {
return isLeftHand;
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!is_keyboard_master()) {
// this method has no effect on slave half

View File

@@ -41,6 +41,10 @@ bool is_keyboard_master(void) {
return isMaster;
}
bool is_keyboard_left(void) {
return isLeftHand;
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!is_keyboard_master()) {
// this method has no effect on slave half

View File

@@ -40,6 +40,10 @@ bool is_keyboard_master(void) {
return isMaster;
}
bool is_keyboard_left(void) {
return isLeftHand;
}
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!isMaster) {
ADD_FAILURE() << "We shouldn't get here.";

View File

@@ -269,7 +269,7 @@ __attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[]
void matrix_init(void) {
#ifdef SPLIT_KEYBOARD
// Set pinout for right half if pinout for that half is defined
if (!isLeftHand) {
if (!is_keyboard_left()) {
# ifdef DIRECT_PINS_RIGHT
const pin_t direct_pins_right[MATRIX_ROWS_PER_HAND][MATRIX_COLS] = DIRECT_PINS_RIGHT;
for (uint8_t i = 0; i < MATRIX_ROWS_PER_HAND; i++) {
@@ -292,7 +292,7 @@ void matrix_init(void) {
# endif
}
thisHand = isLeftHand ? 0 : (MATRIX_ROWS_PER_HAND);
thisHand = is_keyboard_left() ? 0 : (MATRIX_ROWS_PER_HAND);
thatHand = MATRIX_ROWS_PER_HAND - thisHand;
#endif

View File

@@ -144,7 +144,7 @@ __attribute__((weak)) void matrix_slave_scan_user(void) {}
__attribute__((weak)) void matrix_init(void) {
#ifdef SPLIT_KEYBOARD
thisHand = isLeftHand ? 0 : (MATRIX_ROWS_PER_HAND);
thisHand = is_keyboard_left() ? 0 : (MATRIX_ROWS_PER_HAND);
thatHand = MATRIX_ROWS_PER_HAND - thisHand;
#endif