Draft
Conversation
zvecr
requested changes
Jan 25, 2026
quantum/matrix.h
Outdated
| void matrix_init(void); | ||
| /* scan all key states on matrix */ | ||
| uint8_t matrix_scan(void); | ||
| bool matrix_scan(void); |
Member
There was a problem hiding this comment.
This changes the API that custom matrix has to implement, breaking anything that already exists.
Comment on lines
599
to
602
| bool matrix_changed = false; | ||
| for (uint8_t row = 0; row < MATRIX_ROWS && !matrix_changed; row++) { | ||
| matrix_changed |= matrix_previous[row] ^ matrix_get_row(row); | ||
| } |
Member
There was a problem hiding this comment.
This was intentional, as the result of matrix_scan for custom matrix is not consistently implemented.
quantum/matrix_common.c
Outdated
| changed = debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed) | matrix_post_scan(); | ||
| #else | ||
| changed = debounce(raw_matrix, matrix, changed); | ||
| changed = debounce(raw_matrix, matrix, ROWS_PER_HAND, changed); |
Member
There was a problem hiding this comment.
Why is a 4th argument being introduced again?
| } | ||
| } | ||
|
|
||
| matrix_row_t matrix_previous[MATRIX_ROWS]; |
Member
There was a problem hiding this comment.
Moving this increases what "full" custom matrix would have to implement, cascading changes to multiple keyboards.
5fb9fd6 to
fe75b36
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
matrix_previous[MATRIX_ROWS]into the respectivematrix.candmatrix_common.c.matrix_scan()matrix_scan()now returns changed, rather than a comparisonmemcmpover looping per rowMy speed up went from 13800 scans to 14800 scans ~6% increase (with custom matrix) 👍
Types of Changes
Issues Fixed or Closed by This PR
Checklist