summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c')
-rw-r--r--keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
index 700b0685f2..5cd269e311 100644
--- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
+++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
@@ -16,7 +16,7 @@
#include "f411.h"
-void matrix_init_sub_kb(void) { setPinInputHigh(A0); }
+void keyboard_pre_init_sub(void) { setPinInputHigh(A0); }
void matrix_scan_sub_kb(void) {
if (!readPin(A0)) {
@@ -24,6 +24,33 @@ void matrix_scan_sub_kb(void) {
}
}
+void bootmagic_lite(void) {
+ // We need multiple scans because debouncing can't be turned off.
+ matrix_scan();
+#if defined(DEBOUNCE) && DEBOUNCE > 0
+ wait_ms(DEBOUNCE * 2);
+#else
+ wait_ms(30);
+#endif
+ matrix_scan();
+
+ uint8_t row = BOOTMAGIC_LITE_ROW;
+ uint8_t col = BOOTMAGIC_LITE_COLUMN;
+
+#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT)
+ if (!is_keyboard_left()) {
+ row = BOOTMAGIC_LITE_ROW_RIGHT;
+ col = BOOTMAGIC_LITE_COLUMN_RIGHT;
+ }
+#endif
+
+ if (matrix_get_row(row) & (1 << col) || !readPin(A0)) {
+ eeconfig_disable();
+ bootloader_jump();
+ }
+}
+
+
#ifdef USB_VBUS_PIN
bool usb_vbus_state(void) {
setPinInputLow(USB_VBUS_PIN);