Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep track of last matrix activity #10730

Merged
merged 3 commits into from
Jan 12, 2021

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Oct 23, 2020

Description

This PR adds support for recording the last time matrix activity was detected.
Two new APIs have been added:

uint32_t last_matrix_activity_time(void);     // Timestamp of the last matrix activity
uint32_t last_matrix_activity_elapsed(void);  // Number of milliseconds since the last matrix activity

These values are compatible with normal matrix scanning, as well as split_common.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested a review from a team October 23, 2020 03:22
@tzarc tzarc self-assigned this Oct 23, 2020
@tzarc tzarc force-pushed the earlier-slave-matrix-retrieval branch from 970e75f to 78faf47 Compare October 23, 2020 03:40
tmk_core/common/keyboard.c Outdated Show resolved Hide resolved
quantum/split_common/matrix.c Outdated Show resolved Hide resolved
@tzarc tzarc force-pushed the earlier-slave-matrix-retrieval branch 2 times, most recently from 6c8c734 to 0860c29 Compare November 10, 2020 00:06
@noroadsleft noroadsleft deleted the branch qmk:develop November 28, 2020 20:02
@tzarc tzarc reopened this Nov 28, 2020
@tzarc tzarc force-pushed the earlier-slave-matrix-retrieval branch from 0860c29 to ace26c9 Compare December 2, 2020 22:33
@tzarc tzarc requested a review from mtei December 3, 2020 04:38
@tzarc tzarc mentioned this pull request Dec 3, 2020
14 tasks
@drashna drashna requested a review from a team December 8, 2020 01:10
@tzarc
Copy link
Member Author

tzarc commented Dec 17, 2020

@mtei any other concerns, or are we happy with a merge?

@mtei
Copy link
Contributor

mtei commented Dec 19, 2020

It looks like it's working properly. There seems to be no problem.

However, I'm not sure the significance of moving 'transport_master()' into 'matrix_pre_scan()'.

Current matrix.c timing (click)

DS1Z_QuickPrint108_m

This PR's matrix.c timing. (click)

DS1Z_QuickPrint109_m

@tzarc
Copy link
Member Author

tzarc commented Jan 11, 2021

However, I'm not sure the significance of moving 'transport_master()' into 'matrix_pre_scan()'.

@mtei Been a while since I looked at this PR, but I believe it was so that the full matrix is made available at the time matrix_scan_quantum is invoked -- matrix_scan_kb and matrix_scan_user then have an up-to-date view of the slave matrix.

EDIT: Re-investigating, I don't think this is an issue with the old behaviour -- will sort out rollback of that specific portion.

@tzarc tzarc force-pushed the earlier-slave-matrix-retrieval branch from 7427806 to 4efdee0 Compare January 11, 2021 09:16
@tzarc
Copy link
Member Author

tzarc commented Jan 11, 2021

Newer, simpler implementation seems to work fine.

@tzarc tzarc requested a review from drashna January 11, 2021 09:30
@tzarc tzarc merged commit 79d1db3 into qmk:develop Jan 12, 2021
tzarc added a commit to tzarc/qmk_firmware that referenced this pull request Jan 14, 2021
@tzarc tzarc deleted the earlier-slave-matrix-retrieval branch January 15, 2021 00:22
@tzarc tzarc mentioned this pull request Jan 15, 2021
14 tasks
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
* Allow recording of the last matrix activity time, to simplify implementation of display timeouts and the like.

* Add requested changes from code review.

* Simplify split matrix last changed.
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants