diff options
Diffstat (limited to 'keyboards/ergodox_infinity/matrix.c')
| -rw-r--r-- | keyboards/ergodox_infinity/matrix.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/keyboards/ergodox_infinity/matrix.c b/keyboards/ergodox_infinity/matrix.c index 7baacd24d..0fca56a97 100644 --- a/keyboards/ergodox_infinity/matrix.c +++ b/keyboards/ergodox_infinity/matrix.c | |||
| @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 24 | #include "print.h" | 24 | #include "print.h" |
| 25 | #include "debug.h" | 25 | #include "debug.h" |
| 26 | #include "matrix.h" | 26 | #include "matrix.h" |
| 27 | #include "eeconfig.h" | 27 | #include "keyboard.h" |
| 28 | #include "serial_link/system/serial_link.h" | 28 | #include "serial_link/system/serial_link.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| @@ -119,15 +119,9 @@ uint8_t matrix_scan(void) | |||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | uint8_t offset = 0; | 121 | uint8_t offset = 0; |
| 122 | #if (defined(EE_HANDS) || defined(MASTER_IS_ON_RIGHT)) | 122 | if (is_serial_link_master() && !is_keyboard_left()) { |
| 123 | #ifdef EE_HANDS | ||
| 124 | if (is_serial_link_master() && !eeconfig_read_handedness()) { | ||
| 125 | #else | ||
| 126 | if (is_serial_link_master()) { | ||
| 127 | #endif | ||
| 128 | offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; | 123 | offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; |
| 129 | } | 124 | } |
| 130 | #endif | ||
| 131 | 125 | ||
| 132 | if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { | 126 | if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { |
| 133 | for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { | 127 | for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { |
| @@ -167,17 +161,11 @@ void matrix_print(void) | |||
| 167 | 161 | ||
| 168 | void matrix_set_remote(matrix_row_t* rows, uint8_t index) { | 162 | void matrix_set_remote(matrix_row_t* rows, uint8_t index) { |
| 169 | uint8_t offset = 0; | 163 | uint8_t offset = 0; |
| 170 | #ifdef EE_HANDS | 164 | if (is_keyboard_left()) { |
| 171 | if (eeconfig_read_handedness()) { | ||
| 172 | offset = LOCAL_MATRIX_ROWS * (index + 1); | 165 | offset = LOCAL_MATRIX_ROWS * (index + 1); |
| 173 | } else { | 166 | } else { |
| 174 | offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2); | 167 | offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2); |
| 175 | } | 168 | } |
| 176 | #elif defined(MASTER_IS_ON_RIGHT) | ||
| 177 | offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2); | ||
| 178 | #else | ||
| 179 | offset = LOCAL_MATRIX_ROWS * (index + 1); | ||
| 180 | #endif | ||
| 181 | for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { | 169 | for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { |
| 182 | matrix[offset + row] = rows[row]; | 170 | matrix[offset + row] = rows[row]; |
| 183 | } | 171 | } |
