aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/helix/rev2/split_util.c
diff options
context:
space:
mode:
authorMakotoKurauchi <pluis@me.com>2020-03-10 17:33:46 +0900
committerGitHub <noreply@github.com>2020-03-10 01:33:46 -0700
commit2d14d12c7409e8de3f8d465635be115e06ba26f7 (patch)
tree7e16f8a48b5f1d2fcc400869cc02244c6c2cc167 /keyboards/helix/rev2/split_util.c
parent0ba352356deaa741064acc770fa5a8bc57fa8904 (diff)
downloadfirmware-2d14d12c7409e8de3f8d465635be115e06ba26f7.tar.gz
firmware-2d14d12c7409e8de3f8d465635be115e06ba26f7.tar.bz2
firmware-2d14d12c7409e8de3f8d465635be115e06ba26f7.zip
[Keyboard] Helix add split common option (#7718)
* is_master, has_usb() move to rev2.[hc] * Do recent helix/rev2 changes to helix/pico as well. helix/pico/matrix.c: remove 'is_master' helix/pico/pico.c: add 'is_master' helix/pico/pico.h: add 'has_usb()' macro helix/pico/split_util.c: remove 'setup_handedness()' 'has_usb()', add 'is_helix_master()' etc * add HELIX=scan option into {rev2/pico}/local_features.mk Made DEBUG_MATRIX_SCAN_RATE easy to use. * Changed rules.mk to link "helix/local_drivers/ssd1306.c" only when OLED_ENABLE = yes. * Added option to use split_common for helix/rev2, helix/pico keyboard. how to build: ### build helix/pico (HelixPico) with helix current codes $ make helix/pico:KEY_MAP $ make helix/pico/back:KEY_MAP ### build helix/rev2 (Helix or Helix beta) with helix current codes $ make helix:KEY_MAP $ make helix/rev2/back:KEY_MAP $ make helix/rev2/under:KEY_MAP $ make helix/rev2/oled:KEY_MAP $ make helix/rev2/oled/back:KEY_MAP $ make helix/rev2/oled/under:KEY_MAP ### build helix/pico (HelixPico) with split_common codes $ make helix/pico/sc:KEY_MAP $ make helix/pico/sc/back:KEY_MAP $ make helix/pico/sc/under:KEY_MAP ### build helix/rev2 (Helix) with split_common codes $ make helix/rev2/sc:KEY_MAP $ make helix/rev2/sc/back:KEY_MAP $ make helix/rev2/sc/under:KEY_MAP $ make helix/rev2/sc/oled:KEY_MAP $ make helix/rev2/sc/oledback:KEY_MAP $ make helix/rev2/sc/oledunder:KEY_MAP * add matrix_slave_scan_user() to helix/rev2/rev2.c, helix/pico/pico.h * Changed 'helix:xulkal' to always use split_common and removed ad hoc code. Added the following line to 'helix/rev2/keymaps/xulkal/rules.mk': SPLIT_KEYBOARD = yes Removed the following ad hoc code from 'users/xulkal/custom_oled.c': #if KEYBOARD_helix_rev2 extern uint8_t is_master; bool is_keyboard_master(void) { return is_master; } #endif * add '#define DIODE_DIRECTION COL2ROW' into helix/{rev2|pico}/config.h This commit does not change the build result. * update helix readme * keyboards/helix/readme.md * keyboards/helix/pico/keymaps/default/readme.md * keyboards/helix/rev2/keymaps/default/readme.md Co-authored-by: mtei <2170248+mtei@users.noreply.github.com>
Diffstat (limited to 'keyboards/helix/rev2/split_util.c')
-rw-r--r--keyboards/helix/rev2/split_util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c
index 9d31d0dec..ab4031548 100644
--- a/keyboards/helix/rev2/split_util.c
+++ b/keyboards/helix/rev2/split_util.c
@@ -45,7 +45,7 @@ bool waitForUsb(void) {
}
-__attribute__((weak)) bool is_keyboard_left(void) {
+bool is_keyboard_left(void) {
#if defined(SPLIT_HAND_PIN)
// Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
setPinInput(SPLIT_HAND_PIN);
@@ -53,13 +53,13 @@ __attribute__((weak)) bool is_keyboard_left(void) {
#elif defined(EE_HANDS)
return eeconfig_read_handedness();
#elif defined(MASTER_RIGHT)
- return !has_usb();
+ return !is_helix_master();
#endif
- return has_usb();
+ return is_helix_master();
}
-__attribute__((weak)) bool has_usb(void) {
+bool is_helix_master(void) {
static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN;
// only check once, as this is called often
@@ -100,11 +100,10 @@ static void keyboard_slave_setup(void) {
void split_keyboard_setup(void) {
isLeftHand = is_keyboard_left();
- if (has_usb()) {
+ if (is_helix_master()) {
keyboard_master_setup();
} else {
keyboard_slave_setup();
}
sei();
}
-
='n240' href='#n240'>240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334