From bb425b3cfe1effe3440deaf2157d75a35f1aa1eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 20:58:11 +0000 Subject: [PATCH] Fix cross-half RPI timing with SPLIT_ACTIVITY_ENABLE + last_input_activity_elapsed Agent-Logs-Url: https://github.com/timfee/qmk_userspace/sessions/c129e415-070b-4b3e-b26d-2262310412aa Co-authored-by: timfee <3246342+timfee@users.noreply.github.com> --- users/timfee/config.h | 1 + users/timfee/timfee.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/users/timfee/config.h b/users/timfee/config.h index 75a91967..f28ca664 100644 --- a/users/timfee/config.h +++ b/users/timfee/config.h @@ -29,5 +29,6 @@ // ── Split transport ── #define SPLIT_TRANSPORT_MIRROR #define SPLIT_WPM_ENABLE +#define SPLIT_ACTIVITY_ENABLE #define SPLIT_WATCHDOG_TIMEOUT 4000 #define SPLIT_TRANSACTION_IDS_USER USER_SYNC_OLED_STATE, USER_SYNC_LASTKEY, USER_SYNC_PRESSES diff --git a/users/timfee/timfee.c b/users/timfee/timfee.c index c06079c2..10969ba6 100644 --- a/users/timfee/timfee.c +++ b/users/timfee/timfee.c @@ -6,7 +6,8 @@ #endif // ── State for require-prior-idle ── -static uint16_t last_key_time = 0; +// (last_key_time removed: using last_input_activity_elapsed() instead, which +// is synced from both halves via SPLIT_ACTIVITY_ENABLE, fixing cross-half RPI) // ── Combos (matching Vial config) ── const uint16_t PROGMEM lparen_combo[] = {KC_R, KC_T, COMBO_END}; @@ -213,8 +214,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } #endif - // Require-prior-idle handling - uint16_t elapsed = timer_elapsed(last_key_time); + // Require-prior-idle: force tap if pressed too soon after any recent + // activity on either half. SPLIT_ACTIVITY_ENABLE synchronizes the + // underlying activity timestamp from the slave to the master at the + // transport level, so last_input_activity_elapsed() reflects the most + // recent keypress on either half — not just the master side. + uint32_t elapsed = last_input_activity_elapsed(); switch (keycode) { case GU_SPC: @@ -266,8 +271,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; } - - last_key_time = timer_read(); } return true; }