mirror of
https://github.com/qmk/qmk_userspace.git
synced 2026-04-22 11:30:23 -04:00
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>
This commit is contained in:
parent
7cb53d85b9
commit
bb425b3cfe
2 changed files with 9 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue