aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ergodox_infinity/matrix.c
diff options
context:
space:
mode:
authorJoakim Tufvegren <jocke@barbanet.com>2020-10-11 02:48:52 +0200
committerGitHub <noreply@github.com>2020-10-11 01:48:52 +0100
commitcacf495c91c7f6ad0e31edcefa8355eba98f75b6 (patch)
treefce415f8afeb6ee2b388cafc329a4211434d4795 /keyboards/ergodox_infinity/matrix.c
parenta88cfa395ba2eef999d60958a1390e63e0834d55 (diff)
downloadqmk_firmware-cacf495c91c7f6ad0e31edcefa8355eba98f75b6.tar.gz
qmk_firmware-cacf495c91c7f6ad0e31edcefa8355eba98f75b6.zip
Ergodox Infinity: Add EE_HANDS support. (#9527)
Including a guide to set these EEPROM values (in the readme).
Diffstat (limited to 'keyboards/ergodox_infinity/matrix.c')
-rw-r--r--keyboards/ergodox_infinity/matrix.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/keyboards/ergodox_infinity/matrix.c b/keyboards/ergodox_infinity/matrix.c
index 3a0a17928..941367a36 100644
--- a/keyboards/ergodox_infinity/matrix.c
+++ b/keyboards/ergodox_infinity/matrix.c
@@ -24,6 +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 "serial_link/system/serial_link.h" 28#include "serial_link/system/serial_link.h"
28 29
29 30
@@ -118,8 +119,12 @@ uint8_t matrix_scan(void)
118 } 119 }
119 120
120 uint8_t offset = 0; 121 uint8_t offset = 0;
121#ifdef MASTER_IS_ON_RIGHT 122#if (defined(EE_HANDS) || defined(MASTER_IS_ON_RIGHT))
123#ifdef EE_HANDS
124 if (is_serial_link_master() && !eeconfig_read_handedness()) {
125#else
122 if (is_serial_link_master()) { 126 if (is_serial_link_master()) {
127#endif
123 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; 128 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS;
124 } 129 }
125#endif 130#endif
@@ -162,7 +167,13 @@ void matrix_print(void)
162 167
163void matrix_set_remote(matrix_row_t* rows, uint8_t index) { 168void matrix_set_remote(matrix_row_t* rows, uint8_t index) {
164 uint8_t offset = 0; 169 uint8_t offset = 0;
165#ifdef MASTER_IS_ON_RIGHT 170#ifdef EE_HANDS
171 if (eeconfig_read_handedness()) {
172 offset = LOCAL_MATRIX_ROWS * (index + 1);
173 } else {
174 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2);
175 }
176#elif defined(MASTER_IS_ON_RIGHT)
166 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2); 177 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2);
167#else 178#else
168 offset = LOCAL_MATRIX_ROWS * (index + 1); 179 offset = LOCAL_MATRIX_ROWS * (index + 1);