aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-12-29 06:14:48 -0800
committerGitHub <noreply@github.com>2021-12-29 06:14:48 -0800
commit906108fb486797ab2f3eb7c3a6f70e099c1199e6 (patch)
treea5cf602f98240f941677c4b27ce0865b08f2cffd
parentbdce7c8d4a7dc067c31e7115efc1c8caa1bc74bf (diff)
downloadqmk_firmware-906108fb486797ab2f3eb7c3a6f70e099c1199e6.tar.gz
qmk_firmware-906108fb486797ab2f3eb7c3a6f70e099c1199e6.zip
[Keyboard] Update to ZSA Keyboards (#15644)
-rw-r--r--keyboards/ergodox_ez/config.h14
-rw-r--r--keyboards/ergodox_ez/ergodox_ez.c51
-rw-r--r--keyboards/ergodox_ez/ergodox_ez.h22
-rw-r--r--keyboards/ergodox_ez/rules.mk12
-rw-r--r--keyboards/moonlander/config.h12
-rw-r--r--keyboards/moonlander/moonlander.c111
-rw-r--r--keyboards/moonlander/rules.mk3
-rw-r--r--keyboards/planck/ez/config.h13
-rw-r--r--keyboards/planck/ez/ez.c12
-rw-r--r--keyboards/planck/ez/rules.mk7
10 files changed, 158 insertions, 99 deletions
diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h
index c3b794f10..109a80d2c 100644
--- a/keyboards/ergodox_ez/config.h
+++ b/keyboards/ergodox_ez/config.h
@@ -43,12 +43,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
43#define MATRIX_EXPANDER_COL_PINS { 5, 4, 3, 2, 1, 0 } 43#define MATRIX_EXPANDER_COL_PINS { 5, 4, 3, 2, 1, 0 }
44#define MATRIX_EXPANDER_ROW_PINS { 0, 1, 2, 3, 4, 5, 6 } 44#define MATRIX_EXPANDER_ROW_PINS { 0, 1, 2, 3, 4, 5, 6 }
45 45
46 46#define MOUSEKEY_INTERVAL 20
47#define MOUSEKEY_INTERVAL 20 47#define MOUSEKEY_DELAY 0
48#define MOUSEKEY_DELAY 0 48#define MOUSEKEY_TIME_TO_MAX 60
49#define MOUSEKEY_TIME_TO_MAX 60 49#define MOUSEKEY_MAX_SPEED 7
50#define MOUSEKEY_MAX_SPEED 7 50#define MOUSEKEY_WHEEL_DELAY 400
51#define MOUSEKEY_WHEEL_DELAY 0 51#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL
52#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED
53#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX
52 54
53#define DEBOUNCE 30 55#define DEBOUNCE 30
54 56
diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c
index 49f690fa7..8d3790088 100644
--- a/keyboards/ergodox_ez/ergodox_ez.c
+++ b/keyboards/ergodox_ez/ergodox_ez.c
@@ -398,3 +398,54 @@ void eeconfig_init_kb(void) { // EEPROM is getting reset!
398 eeconfig_update_kb(keyboard_config.raw); 398 eeconfig_update_kb(keyboard_config.raw);
399 eeconfig_init_user(); 399 eeconfig_init_user();
400} 400}
401
402#ifdef ORYX_ENABLE
403static uint16_t loops = 0;
404static bool is_on = false;
405#endif
406
407#ifdef DYNAMIC_MACRO_ENABLE
408static bool is_dynamic_recording = false;
409static uint16_t dynamic_loop_timer;
410
411void dynamic_macro_record_start_user(void) {
412 is_dynamic_recording = true;
413 dynamic_loop_timer = timer_read();
414 ergodox_right_led_1_on();
415}
416
417void dynamic_macro_record_end_user(int8_t direction) {
418 is_dynamic_recording = false;
419 layer_state_set_user(layer_state);
420}
421#endif
422
423void matrix_scan_kb(void) {
424#ifdef DYNAMIC_MACRO_ENABLE
425 if (is_dynamic_recording) {
426 ergodox_right_led_1_off();
427 // if (timer_elapsed(dynamic_loop_timer) > 5)
428 {
429 static uint8_t counter;
430 counter++;
431 if (counter > 100) ergodox_right_led_1_on();
432 dynamic_loop_timer = timer_read();
433 }
434 }
435#endif
436
437#ifdef CAPS_LOCK_STATUS
438 led_t led_state = host_keyboard_led_state();
439 if(led_state.caps_lock) {
440 ergodox_right_led_3_on();
441 }
442 else {
443 uint8_t layer = get_highest_layer(layer_state);
444 if(layer != 1) {
445 ergodox_right_led_3_off();
446 }
447 }
448#endif
449
450 matrix_scan_user();
451}
diff --git a/keyboards/ergodox_ez/ergodox_ez.h b/keyboards/ergodox_ez/ergodox_ez.h
index 7bb271714..7243a6a18 100644
--- a/keyboards/ergodox_ez/ergodox_ez.h
+++ b/keyboards/ergodox_ez/ergodox_ez.h
@@ -292,3 +292,25 @@ extern keyboard_config_t keyboard_config;
292 { R05, R15, R25, R35, R45, R55 }, \ 292 { R05, R15, R25, R35, R45, R55 }, \
293 { R06, R16, R26, R36, R46, KC_NO } \ 293 { R06, R16, R26, R36, R46, KC_NO } \
294 } 294 }
295
296/* ---- LEFT HAND ---- ---- RIGHT HAND ---- */
297#define LED_LAYOUT_ergodox_pretty( \
298 L01,L02,L03,L04,L05, R01,R02,R03,R04,R05, \
299 L11,L12,L13,L14,L15, R11,R12,R13,R14,R15, \
300 L21,L22,L23,L24,L25, R21,R22,R23,R24,R25, \
301 L31,L32,L33,L34,L35, R31,R32,R33,R34,R35, \
302 L41,L42,L43,L44, R42,R43,R44,R45 ) \
303 \
304 /* matrix positions */ \
305 { R01, R02, R03, R04, R05, \
306 R11, R12, R13, R14, R15, \
307 R21, R22, R23, R24, R25, \
308 R31, R32, R33, R34, R35, \
309 R42, R43, R44, R45, \
310 \
311 L05, L04, L03, L02, L01, \
312 L15, L14, L13, L12, L11, \
313 L25, L24, L23, L22, L21, \
314 L35, L34, L33, L32, L31, \
315 L44, L43, L42, L41 \
316 }
diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk
index e64805392..1b4ace5ee 100644
--- a/keyboards/ergodox_ez/rules.mk
+++ b/keyboards/ergodox_ez/rules.mk
@@ -12,15 +12,15 @@ BOOTLOADER = halfkay
12# Build Options 12# Build Options
13# change yes to no to disable 13# change yes to no to disable
14# 14#
15BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite 15BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
16MOUSEKEY_ENABLE = yes # Mouse keys 16MOUSEKEY_ENABLE = yes # Mouse keys
17EXTRAKEY_ENABLE = yes # Audio control and System control 17EXTRAKEY_ENABLE = yes # Audio control and System control
18CONSOLE_ENABLE = no # Console for debug 18CONSOLE_ENABLE = no # Console for debug
19COMMAND_ENABLE = yes # Commands for debug and configuration 19COMMAND_ENABLE = no # Commands for debug and configuration
20CUSTOM_MATRIX = lite # Custom matrix file for the ErgoDox EZ 20CUSTOM_MATRIX = lite # Custom matrix file for the ErgoDox EZ
21NKRO_ENABLE = yes # Enable N-Key Rollover 21NKRO_ENABLE = yes # Enable N-Key Rollover
22UNICODE_ENABLE = yes # Unicode 22UNICODE_ENABLE = no # Unicode
23SWAP_HANDS_ENABLE= yes # Allow swapping hands of keyboard 23SWAP_HANDS_ENABLE= no # Allow swapping hands of keyboard
24 24
25RGB_MATRIX_ENABLE = no # enable later 25RGB_MATRIX_ENABLE = no # enable later
26RGB_MATRIX_DRIVER = IS31FL3731 26RGB_MATRIX_DRIVER = IS31FL3731
@@ -36,3 +36,5 @@ LAYOUTS = ergodox
36# Disable unsupported hardware 36# Disable unsupported hardware
37AUDIO_SUPPORTED = no 37AUDIO_SUPPORTED = no
38BACKLIGHT_SUPPORTED = no 38BACKLIGHT_SUPPORTED = no
39
40MOUSE_SHARED_EP = no
diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h
index 1c6cbb5c6..d6686425c 100644
--- a/keyboards/moonlander/config.h
+++ b/keyboards/moonlander/config.h
@@ -141,6 +141,18 @@
141# define ENABLE_RGB_MATRIX_SOLID_SPLASH 141# define ENABLE_RGB_MATRIX_SOLID_SPLASH
142# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH 142# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
143 143
144// #define RGB_MATRIX_LED_PROCESS_LIMIT 5
145// #define RGB_MATRIX_LED_FLUSH_LIMIT 26
146
147#define MOUSEKEY_INTERVAL 20
148#define MOUSEKEY_DELAY 0
149#define MOUSEKEY_TIME_TO_MAX 60
150#define MOUSEKEY_MAX_SPEED 7
151#define MOUSEKEY_WHEEL_DELAY 400
152#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL
153#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED
154#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX
155
144#define MUSIC_MAP 156#define MUSIC_MAP
145 157
146#define FIRMWARE_VERSION_SIZE 17 158#define FIRMWARE_VERSION_SIZE 17
diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c
index d5105c26c..ea50226f0 100644
--- a/keyboards/moonlander/moonlander.c
+++ b/keyboards/moonlander/moonlander.c
@@ -19,9 +19,6 @@
19 19
20 20
21#include "moonlander.h" 21#include "moonlander.h"
22#ifdef WEBUSB_ENABLE
23# include "webusb.h"
24#endif
25 22
26keyboard_config_t keyboard_config; 23keyboard_config_t keyboard_config;
27 24
@@ -83,50 +80,9 @@ void moonlander_led_task(void) {
83 wait_ms(155); 80 wait_ms(155);
84 } 81 }
85#endif 82#endif
86#ifdef WEBUSB_ENABLE 83#if !defined(MOONLANDER_USER_LEDS)
87 else if (webusb_state.pairing == true) { 84 else {
88 static uint8_t led_mask; 85 layer_state_set_kb(layer_state);
89
90 ML_LED_1(false);
91 ML_LED_2(false);
92 ML_LED_3(false);
93 ML_LED_4(false);
94 ML_LED_5(false);
95 ML_LED_6(false);
96
97 if (!led_mask) {
98 led_mask = 1;
99 } else {
100 led_mask++;
101 if (led_mask > 12) led_mask = 1;
102 }
103 switch (led_mask) {
104 case 1:
105 case 12:
106 ML_LED_1(true);
107 break;
108 case 2:
109 case 11:
110 ML_LED_2(true);
111 break;
112 case 3:
113 case 10:
114 ML_LED_3(true);
115 break;
116 case 4:
117 case 9:
118 ML_LED_4(true);
119 break;
120 case 5:
121 case 8:
122 ML_LED_5(true);
123 break;
124 case 6:
125 case 7:
126 ML_LED_6(true);
127 break;
128 }
129 wait_ms(150);
130 } 86 }
131#endif 87#endif
132} 88}
@@ -163,40 +119,53 @@ void keyboard_pre_init_kb(void) {
163layer_state_t layer_state_set_kb(layer_state_t state) { 119layer_state_t layer_state_set_kb(layer_state_t state) {
164 state = layer_state_set_user(state); 120 state = layer_state_set_user(state);
165 if (is_launching || !keyboard_config.led_level) return state; 121 if (is_launching || !keyboard_config.led_level) return state;
166 122 bool LED_1 = false;
167 ML_LED_1(false); 123 bool LED_2 = false;
168 ML_LED_2(false); 124 bool LED_3 = false;
169 ML_LED_3(false); 125 bool LED_4 = false;
170 ML_LED_4(false); 126 bool LED_5 = false;
171 ML_LED_5(false); 127 bool LED_6 = false;
172 ML_LED_6(false);
173 128
174 uint8_t layer = get_highest_layer(state); 129 uint8_t layer = get_highest_layer(state);
175 switch (layer) { 130 switch (layer) {
176 case 1: 131 case 1:
177 ML_LED_1(1); 132 LED_1 = true;
178 ML_LED_4(1); 133 LED_4 = true;
179 break; 134 break;
180 case 2: 135 case 2:
181 ML_LED_2(1); 136 LED_2 = true;
182 ML_LED_5(1); 137 LED_5 = true;
183 break; 138 break;
184 case 3: 139 case 3:
185 ML_LED_3(1); 140 LED_3 = true;
141#if !defined(CAPS_LOCK_STATUS)
142 LED_6 = true;
143#endif
186 break; 144 break;
187 case 4: 145 case 4:
188 ML_LED_4(1); 146 LED_4 = true;
189 break; 147 break;
190 case 5: 148 case 5:
191 ML_LED_5(1); 149 LED_5 = true;
192 break; 150 break;
193 case 6: 151 case 6:
194 ML_LED_6(1); 152#if !defined(CAPS_LOCK_STATUS)
153 LED_6 = true;
154#endif
195 break; 155 break;
196 default: 156 default:
197 break; 157 break;
198 } 158 }
199 159
160 ML_LED_1(LED_1);
161 ML_LED_2(LED_2);
162 ML_LED_3(LED_3);
163 ML_LED_4(LED_4);
164 ML_LED_5(LED_5);
165#if !defined(CAPS_LOCK_STATUS)
166 ML_LED_6(LED_6);
167#endif
168
200 return state; 169 return state;
201} 170}
202#endif 171#endif
@@ -398,15 +367,19 @@ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_moonlander(
398// clang-format on 367// clang-format on
399#endif 368#endif
400 369
401#ifdef ORYX_CONFIGURATOR 370#ifdef CAPS_LOCK_STATUS
371bool led_update_kb(led_t led_state) {
372 bool res = led_update_user(led_state);
373 if(res) {
374 ML_LED_6(led_state.caps_lock);
375 }
376 return res;
377}
378#endif
379
402bool process_record_kb(uint16_t keycode, keyrecord_t *record) { 380bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
403 if (!process_record_user(keycode, record)) { return false; } 381 if (!process_record_user(keycode, record)) { return false; }
404 switch (keycode) { 382 switch (keycode) {
405#ifdef WEBUSB_ENABLE
406 case WEBUSB_PAIR:
407 if (!record->event.pressed && !webusb_state.pairing) layer_state_set_kb(layer_state);
408 break;
409#endif
410#if !defined(MOONLANDER_USER_LEDS) 383#if !defined(MOONLANDER_USER_LEDS)
411 case LED_LEVEL: 384 case LED_LEVEL:
412 if (record->event.pressed) { 385 if (record->event.pressed) {
@@ -454,8 +427,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
454 return true; 427 return true;
455} 428}
456 429
457#endif
458
459void matrix_init_kb(void) { 430void matrix_init_kb(void) {
460 keyboard_config.raw = eeconfig_read_kb(); 431 keyboard_config.raw = eeconfig_read_kb();
461 432
diff --git a/keyboards/moonlander/rules.mk b/keyboards/moonlander/rules.mk
index 01994ba93..72682d29b 100644
--- a/keyboards/moonlander/rules.mk
+++ b/keyboards/moonlander/rules.mk
@@ -16,6 +16,7 @@ NKRO_ENABLE = yes # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 17RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
18AUDIO_ENABLE = yes # Audio output 18AUDIO_ENABLE = yes # Audio output
19AUDIO_DRIVER = dac_additive
19CUSTOM_MATRIX = lite 20CUSTOM_MATRIX = lite
20SWAP_HANDS_ENABLE = yes 21SWAP_HANDS_ENABLE = yes
21RGB_MATRIX_ENABLE = yes 22RGB_MATRIX_ENABLE = yes
@@ -25,3 +26,5 @@ EEPROM_DRIVER = i2c
25#project specific files 26#project specific files
26SRC += matrix.c 27SRC += matrix.c
27QUANTUM_LIB_SRC += i2c_master.c 28QUANTUM_LIB_SRC += i2c_master.c
29
30MOUSE_SHARED_EP = no
diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h
index 508551472..537c21509 100644
--- a/keyboards/planck/ez/config.h
+++ b/keyboards/planck/ez/config.h
@@ -183,8 +183,11 @@
183 183
184#define TAPPING_TOGGLE 1 184#define TAPPING_TOGGLE 1
185 185
186#define MOUSEKEY_INTERVAL 20 186#define MOUSEKEY_INTERVAL 20
187#define MOUSEKEY_DELAY 0 187#define MOUSEKEY_DELAY 0
188#define MOUSEKEY_TIME_TO_MAX 60 188#define MOUSEKEY_TIME_TO_MAX 60
189#define MOUSEKEY_MAX_SPEED 7 189#define MOUSEKEY_MAX_SPEED 7
190#define MOUSEKEY_WHEEL_DELAY 0 190#define MOUSEKEY_WHEEL_DELAY 400
191#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL
192#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED
193#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX
diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c
index 5c68726a0..98ec13085 100644
--- a/keyboards/planck/ez/ez.c
+++ b/keyboards/planck/ez/ez.c
@@ -106,16 +106,6 @@ led_config_t g_led_config = { {
106 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1 106 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1
107} }; 107} };
108 108
109void suspend_power_down_kb(void) {
110 rgb_matrix_set_color_all(0, 0, 0);
111 rgb_matrix_set_suspend_state(true);
112 suspend_power_down_user();
113}
114
115 void suspend_wakeup_init_kb(void) {
116 rgb_matrix_set_suspend_state(false);
117 suspend_wakeup_init_user();
118}
119#endif 109#endif
120 110
121/* Left B9 Right B8 */ 111/* Left B9 Right B8 */
@@ -259,7 +249,7 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
259 planck_ez_left_led_off(); 249 planck_ez_left_led_off();
260 planck_ez_right_led_off(); 250 planck_ez_right_led_off();
261 state = layer_state_set_user(state); 251 state = layer_state_set_user(state);
262 uint8_t layer = biton32(state); 252 uint8_t layer = get_highest_layer(state);
263 switch (layer) { 253 switch (layer) {
264 case PLANCK_EZ_LED_LOWER: 254 case PLANCK_EZ_LED_LOWER:
265 planck_ez_left_led_on(); 255 planck_ez_left_led_on();
diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk
index 9da538da6..61d3eb4d4 100644
--- a/keyboards/planck/ez/rules.mk
+++ b/keyboards/planck/ez/rules.mk
@@ -11,10 +11,11 @@ BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
11MOUSEKEY_ENABLE = yes # Mouse keys 11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control 12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug 13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = yes # Commands for debug and configuration 14COMMAND_ENABLE = yes # Commands for debug and configuration
15NKRO_ENABLE = yes # Enable N-Key Rollover 15NKRO_ENABLE = yes # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 16BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
17AUDIO_ENABLE = yes # Audio output 17AUDIO_ENABLE = yes # Audio output
18AUDIO_DRIVER = dac_additive
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. 19RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
19 20
20ENCODER_ENABLE = yes 21ENCODER_ENABLE = yes
@@ -26,3 +27,5 @@ LAYOUTS_HAS_RGB = no
26RGB_MATRIX_SUPPORTED = yes 27RGB_MATRIX_SUPPORTED = yes
27RGBLIGHT_SUPPORTED = no 28RGBLIGHT_SUPPORTED = no
28BAKCLIGHT_SUPPORTED = no 29BAKCLIGHT_SUPPORTED = no
30
31MOUSE_SHARED_EP = no