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

Add modifier state to the split keyboard transport #10400

Merged
merged 3 commits into from Dec 17, 2020
Merged

Conversation

cwebster2
Copy link
Contributor

@cwebster2 cwebster2 commented Sep 23, 2020

Description

This adds modifier state to the i2c and serial transport for split
keyboards. The purpose of this is to allow e.g. displaying modifier
state on the slave side of a split keyboard on an oled. This adds two
or three bytes to the data transferred between split halves.

This also fixes a missing ifdef guard for BACKLIGHT_ENABLE.

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).

quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
@fauxpark fauxpark requested a review from a team September 23, 2020 06:17
@fauxpark fauxpark added breaking_change Changes that need to wait for a version increment core enhancement labels Sep 23, 2020
@cwebster2
Copy link
Contributor Author

I have incorporated all the suggested changes into my PR.

Copy link
Member

@fauxpark fauxpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some slight cosmetic fixes.

quantum/split_common/transport.c Show resolved Hide resolved
quantum/split_common/transport.c Show resolved Hide resolved
quantum/split_common/transport.c Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
@cwebster2
Copy link
Contributor Author

I think i've now addressed the above comments.

quantum/split_common/transport.c Show resolved Hide resolved
quantum/split_common/transport.c Show resolved Hide resolved
quantum/split_common/transport.c Show resolved Hide resolved
quantum/split_common/transport.c Outdated Show resolved Hide resolved
@fauxpark fauxpark requested a review from a team September 23, 2020 16:34
@tzarc tzarc requested a review from zvecr October 3, 2020 18:27
Copy link
Member

@zvecr zvecr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this will change the scan rate a fair bit, this change should be optional, opt-in rather than out. That way boards which have zero reason to use the data, no oled etc, can remain as fast as they used to be.

@cwebster2
Copy link
Contributor Author

Given this will change the scan rate a fair bit, this change should be optional, opt-in rather than out. That way boards which have zero reason to use the data, no oled etc, can remain as fast as they used to be.

The added code is now behind a define to make it opt-in.

@drashna
Copy link
Member

drashna commented Oct 4, 2020

Also, could you add documentation for this. It doesn't need to be extensive, but it should be documented.
https://github.com/qmk/qmk_firmware/blob/master/docs/feature_split_keyboard.md

@cwebster2
Copy link
Contributor Author

Also, could you add documentation for this. It doesn't need to be extensive, but it should be documented.
https://github.com/qmk/qmk_firmware/blob/master/docs/feature_split_keyboard.md

I have documented the define under communication options on this page and made mention that it of cosmetic use and may impact the matrix scan rate if enabled per zvecr's earlier comment in this PR.

@fauxpark
Copy link
Member

@cwebster2 looks like this needs a rebase, sorry.

@cwebster2
Copy link
Contributor Author

I will take care of that later today.

@cwebster2
Copy link
Contributor Author

@fauxpark I have rebased my branch against qmk/develop

@cwebster2
Copy link
Contributor Author

@zvecr this has probably fallen off the radar, but wondering if your change request has been satisfied and it this is ready to merge.

@cwebster2
Copy link
Contributor Author

I've rebased this PR against develop yet again, but squashed it into a single commit this time.

Out of curiosity, what workflow is in use in this branch that results in this frequent history rewriting?

This adds modifier state to the i2c and serial transport for split
keyboards.  The purpose of this is to allow e.g. displaying modifier
state on the slave side of a split keyboard on an oled.  This adds one
byte to the data transferred between halves.

This also fixes a missing ifdef guard for BLACKLIGHT_ENABLE.

Break modifiers into real/weak/oneshot

Fix incorrect slave serial mod setting

Fix typo in serial weal mod setter

Fix build errors for the I2C code that I introduced

Code cleanup and formatting per project preferences

Correctly get oneshot mods

Fix missing braces

Remove unneeded ifdef guard

Make the added state transport optional

Add documentation for the new define to enable this feature

Fix stray grave mark
@tzarc tzarc merged commit 5e2b535 into qmk:develop Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change Changes that need to wait for a version increment core documentation enhancement needs doc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants