aboutsummaryrefslogtreecommitdiff
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
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).
-rw-r--r--keyboards/ergodox_infinity/matrix.c15
-rw-r--r--keyboards/ergodox_infinity/readme.md36
2 files changed, 47 insertions, 4 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);
diff --git a/keyboards/ergodox_infinity/readme.md b/keyboards/ergodox_infinity/readme.md
index d712bb880..73ee3bc1d 100644
--- a/keyboards/ergodox_infinity/readme.md
+++ b/keyboards/ergodox_infinity/readme.md
@@ -29,6 +29,9 @@ Input Club Infinity Ergodox](https://github.com/fredizzimo/infinity_ergodox/blob
29The Infinity is two completely independent keyboards, that can connect together. 29The Infinity is two completely independent keyboards, that can connect together.
30You have a few options in how you flash the firmware: 30You have a few options in how you flash the firmware:
31 31
32- Add `#define EE_HANDS` to your config.h, initialize the EEPROM values (see below),
33 and then flash the same firmware to both halves.
34
32- Flash the left half, rebuild the firmware with "MASTER=right" and then flash 35- Flash the left half, rebuild the firmware with "MASTER=right" and then flash
33 the right half. This allows you to plug in either half directly to the 36 the right half. This allows you to plug in either half directly to the
34 computer and is what the above instructions do. 37 computer and is what the above instructions do.
@@ -43,6 +46,35 @@ You have a few options in how you flash the firmware:
43 directly connect the right half to the computer. 46 directly connect the right half to the computer.
44 47
45- For minor changes such as changing only the keymap without having updated 48- For minor changes such as changing only the keymap without having updated
46 any part of the firmware code itself, you can program only the MASTER half. 49 any part of the firmware code itself, you can program only the MASTER half,
50 but it is safest to program both halves.
51
52### EE_HANDS initialization
53
54To initialize the EEPROM values for `EE_HANDS` to work properly, these steps should work.
55They only need to be done once, unless you reset the EEPROM later.
56
57 - Plug in the left keyboard half to the computer, and press its program button.
58
59 - Flash the left half with `make ergodox_infinity:default:dfu-util-split-left`
60 (If you need to use a different method to flash your keyboard, still run this command,
61 and abort it with Ctrl+C when the flashing attempts starts to print errors,
62 then flash the built firmware).
63
64 - On the left half, press the top vertical 1.5U key (second from the top in the rightmost column) once,
65 then the 1U key at the bottom in the opposite corner (bottom left corner).
66
67 - Plug in the right keyboard half to the computer, and press its program button.
68
69 - Flash the right half with `make ergodox_infinity:default:dfu-util-split-right`
70
71 - On the right half, press the top vertical 1.5U key (second from the top in the leftmost column) once,
72 then the 1U key at the bottom in the opposite corner (bottom right corner).
73
74 - Add `#define EE_HANDS` to the config.h file of your keymap, and build your firmware using
75 `make ergodox_infinity:keymapname`.
76
77 - After this, you can flash both halves with the same firmware, _without_ having to rebuild with
78 "MASTER=right" or risking a mirrored keyboard when connected the wrong way.
79 If you reset your EEPROM later, you'll have to follow these steps again, though.
47 80
48- It is safest to program both halves though.