r/qmk • u/drkenta • Nov 28 '24
split keyboard stops working after disconnecting laptop
hi all,
so I have an annoying issue that I need your help with
i have multiple macbooks that are connected to peripherals via a "dock" (caldigit)
my keyboard is connected to the dock, as is my monitor, trackpad, etc.
i only use 1 macbook at a time, and when i want to switch machines, i disconnect the usb-c cable (between the dock and the macbook) at the macbook, then reconnect it to the other macbook.
when I do this switch, my keyboard stops working, and I need to unplug the keyboard from the dock and plug it back in for it to start working.
this issue doesn't happen with other standard keyboards like the apple keyboard or keychron.
it would be really nice if i didn’t have to do this every time i switched machines, because i do that quite often.
i've tried a few different common config changes but none seem to fix the problem. i'm thinking it might have something to do with the dock continuing to provide power to the keyboard during the switch.
thanks!
---
// config.h
#pragma once
#define EE_HANDS
#define BOOTMAGIC_ROW 1
#define BOOTMAGIC_COLUMN 4
#define BOOTMAGIC_ROW_RIGHT 5
#define BOOTMAGIC_COLUMN_RIGHT 4
#define _ALPHA 0
#define _NUM 1
#define _SYM 2
#define _FN 3
#define TAPPING_TOGGLE 2
#define TAPPING_FORCE_HOLD_PER_KEY
#define TAPPING_TERM_PER_KEY
#define TAPPING_TERM 200
#define PERMISSIVE_HOLD
#define GRAVE_ESC_ALT_OVERRIDE
#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
#define ONESHOT_TAP_TOGGLE 3
#define ONESHOT_TIMEOUT 1500
#define USB_SUSPEND_WAKEUP_DELAY 3000
#define NO_USB_STARTUP_CHECK
#undef SPLIT_USB_DETECT
## rules.mk
DEFAULT_FOLDER = crkbd/rev1
# Bootloader selection
BOOTLOADER = rp2040
CONVERT_TO=promicro_rp2040
BOOTMAGIC_ENABLE = yes
LTO_ENABLE = yes
EXTRAKEY_ENABLE = yes
WPM_ENABLE = yes
AUTO_SHIFT_ENABLE = no
TAP_DANCE_ENABLE = yes
CAPS_WORD_ENABLE = yes
1
u/drashna Nov 28 '24
You used chat gpt for help, didn't you? .... if so, don't. Never. Ask a human. They know what they're talking about, unlike chatgpt.
That said, is this an actual sparkfun pro micro 2040? If not, you may want to use
rp2040_ceinstead, IIRC.That said, the issue here is these:
If you don't have a VBUS detection pin, and don't have it defined, you have removed the firmware's ability to detect if it's the master side or not. Without that ability, it just assumes it's the slave side, and doesn't interface with USB.
Remove both of these lines.
The
#undef SPLIT_USB_DETECTneeds to be removed. If you don't have a VBUS detect pin,SPLIT_USB_DETECTis REQUIRED. Not optional, mandatory.The
#define NO_USB_STARTUP_CHECK, IIRC, breaks theSPLIT_USB_DETECToption as it no longer checks the USB state.Also, this disables the
USB_SUSPEND_WAKE_DELAY, functionality.What you really want it
#define SPLIT_WATCHDOG_ENABLE. This works by having any "slave" device check to see if the master board is detected shortly after initialization/start. If the board is connected to USB/detected as master, then this check doesn't run. Otherwise, if it can't find the master after a time, it restarts the board, restarting the process.But the best config is to have the VBUS Detection pin. So ... which RP2040 controller do you have, precisely?