]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/handwired/splittest/teensy_2/teensy_2.c
[Keyboard] Refactor handwired/splittest to support multiple boards (#6373)
[qmk_firmware.git] / keyboards / handwired / splittest / teensy_2 / teensy_2.c
diff --git a/keyboards/handwired/splittest/teensy_2/teensy_2.c b/keyboards/handwired/splittest/teensy_2/teensy_2.c
new file mode 100644 (file)
index 0000000..bcc2a43
--- /dev/null
@@ -0,0 +1,14 @@
+#include QMK_KEYBOARD_H
+
+bool is_keyboard_master(void) {
+    // TODO: replace this override once USB host detection is implemented
+    // SPLIT_HAND_PIN Combined with MASTER_LEFT or MASTER_RIGHT, gives a crude
+    // way to force teensy to run as slave/master
+    setPinInput(SPLIT_HAND_PIN);
+
+#if defined(MASTER_RIGHT)
+    return !readPin(SPLIT_HAND_PIN);
+#else
+    return readPin(SPLIT_HAND_PIN);
+#endif
+}