diff options
author | Joakim Tufvegren <jocke@barbanet.com> | 2020-10-11 02:48:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-11 01:48:52 +0100 |
commit | cacf495c91c7f6ad0e31edcefa8355eba98f75b6 (patch) | |
tree | fce415f8afeb6ee2b388cafc329a4211434d4795 /keyboards/ergodox_infinity/matrix.c | |
parent | a88cfa395ba2eef999d60958a1390e63e0834d55 (diff) | |
download | qmk_firmware-cacf495c91c7f6ad0e31edcefa8355eba98f75b6.tar.gz |
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.c | 15 |
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/>. #include "print.h" #include "debug.h" #include "matrix.h" +#include "eeconfig.h" #include "serial_link/system/serial_link.h" @@ -118,8 +119,12 @@ uint8_t matrix_scan(void) } uint8_t offset = 0; -#ifdef MASTER_IS_ON_RIGHT +#if (defined(EE_HANDS) || defined(MASTER_IS_ON_RIGHT)) +#ifdef EE_HANDS + if (is_serial_link_master() && !eeconfig_read_handedness()) { +#else if (is_serial_link_master()) { +#endif offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; } #endif @@ -162,7 +167,13 @@ void matrix_print(void) void matrix_set_remote(matrix_row_t* rows, uint8_t index) { uint8_t offset = 0; -#ifdef MASTER_IS_ON_RIGHT +#ifdef EE_HANDS + if (eeconfig_read_handedness()) { + offset = LOCAL_MATRIX_ROWS * (index + 1); + } else { + offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2); + } +#elif defined(MASTER_IS_ON_RIGHT) offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2); #else offset = LOCAL_MATRIX_ROWS * (index + 1); |