diff options
Diffstat (limited to 'docs/ChangeLog')
| -rw-r--r-- | docs/ChangeLog/20250831/pr25415.md | 47 | ||||
| -rw-r--r-- | docs/ChangeLog/20251130/PR25515.md | 3 | ||||
| -rw-r--r-- | docs/ChangeLog/20251130/PR25632.md | 4 |
3 files changed, 54 insertions, 0 deletions
diff --git a/docs/ChangeLog/20250831/pr25415.md b/docs/ChangeLog/20250831/pr25415.md new file mode 100644 index 0000000000..54eb8c737e --- /dev/null +++ b/docs/ChangeLog/20250831/pr25415.md @@ -0,0 +1,47 @@ +# Tap dance state removed from `tap_dance_action_t` + +The tap dance state has been separated from the action structure. Custom tap dance functions now receive the state as a separate parameter instead of accessing it through `action->state`. + +## User Action Required + +If your keymap uses custom tap dance functions that access the tap dance state, you need to update your code. + + - You can't use `action->state`. Instead you need to call `tap_dance_state_t *tap_dance_get_state(uint8_t tap_dance_idx)` to get the state. + - You now get a pointer to the state, so use `->` notation rather than `.` notation to get fields from it. + +### Before: +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_action_t *action; + + switch (keycode) { + case TD(CT_CLN): + action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(keycode)); + if (!record->event.pressed && action->state.count && !action->state.finished) { + tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)action->user_data; + tap_code16(tap_hold->tap); + } + + } + return true; +} +``` + +### After: +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_action_t *action; + tap_dance_state_t* state; + + switch (keycode) { + case TD(CT_CLN): + action = tap_dance_get(QK_TAP_DANCE_GET_INDEX(keycode)); + state = tap_dance_get_state(QK_TAP_DANCE_GET_INDEX(keycode)); + if (!record->event.pressed && state != NULL && state->count && !state->finished) { + tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)action->user_data; + tap_code16(tap_hold->tap); + } + } + return true; +} +``` diff --git a/docs/ChangeLog/20251130/PR25515.md b/docs/ChangeLog/20251130/PR25515.md new file mode 100644 index 0000000000..ccc88e0c64 --- /dev/null +++ b/docs/ChangeLog/20251130/PR25515.md @@ -0,0 +1,3 @@ +# Refactor debounce algorithm with static allocation [#25515](https://github.com/qmk/qmk_firmware/pull/25515) + +Removed dynamic memory allocation (malloc, free) from all debounce implementations for improved efficiency on embedded systems and to avoid runtime allocation overhead. Refactored state arrays to use direct indexing, simplifying code and eliminating pointer arithmetic. Standardized usage of MATRIX_ROWS_PER_HAND throughout the codebase to ensure consistent support for split keyboards. diff --git a/docs/ChangeLog/20251130/PR25632.md b/docs/ChangeLog/20251130/PR25632.md new file mode 100644 index 0000000000..39136067b9 --- /dev/null +++ b/docs/ChangeLog/20251130/PR25632.md @@ -0,0 +1,4 @@ +# Changes Requiring User Action +## Debounce: Deprecate init and remove num_rows parameter [#25632](https://github.com/qmk/qmk_firmware/pull/25632) + +With dynamic memory allocation removed from all debounce implementations ([#25515](https://github.com/qmk/qmk_firmware/pull/25515)), the `num_rows` parameter has been removed from the `debounce_init()` and `debounce()` functions. The `MATRIX_ROWS_PER_HAND` is now used by default in every implementation. |