-
-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Rework encoders to enable asymmetric split keyboards #12090
Conversation
Heads up that these changes will almost certainly conflict with those in #11706. I'd be willing to resolve those conflicts when they arise. |
da514a0
to
91ae274
Compare
f3b7e8b
to
8f2f14f
Compare
So I've just spent a few hours unsuccessfully trying to get even a single unit test to compile. I've hit only brick walls. If anyone wants to help with that over here, I would be thankful. That said, I've removed all efforts towards unit tests from this PR so that it's clean and ready to merge. |
Two users/boards implement their own I'm leaving it to @drashna to adopt the changes I made to |
I have finally managed to add some unit tests! Thanks a bunch to @ThreeFx for the help! |
Those are all mine, so no worries. And I plan on deprecating them in the near future, as well.
Huzzah! |
#define ENCODERS_PAD_A { } | ||
#define ENCODERS_PAD_B { } | ||
#define ENCODER_RESOLUTIONS { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth removing this.
In the encoder.c file, you could add:
#ifndef ENCODERS_PAD_A
# define ENCODERS_PAD_A { }
#endif
Or the like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit worried about making things confusing. Leaving out the left side would have very different effect from leaving out the right side. Leave out the _RIGHT
pads, the pads get mirrored and you get encoders on both sides. But leave out the "normal" (aka. left) pads and you only get encoders on right.
It would also mean that a board with encoders on only left would look different from a board with encoders only on right:
// only right
#define ENCODERS_PAD_A_RIGHT { X }
#define ENCODERS_PAD_A_RIGHT { Y }
// only left
#define ENCODERS_PAD_A { X }
#define ENCODERS_PAD_A { Y }
#define ENCODERS_PAD_A_RIGHT { }
#define ENCODERS_PAD_A_RIGHT { }
Waddaya think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'd prefer to explicitly require both sides in definitions, if an asymmetrical encoder setup is defined.
So you could do the #ifdef
, but I'm not sure it's the most readable/understandable/maintainable.
So yeah, my vote would be both:
// only right
#define ENCODERS_PAD_A { }
#define ENCODERS_PAD_A { }
#define ENCODERS_PAD_A_RIGHT { X }
#define ENCODERS_PAD_A_RIGHT { Y }
// only left
#define ENCODERS_PAD_A { X }
#define ENCODERS_PAD_A { Y }
#define ENCODERS_PAD_A_RIGHT { }
#define ENCODERS_PAD_A_RIGHT { }
It's been a while. Anything more I can do to get this merged? |
Thank you for your contribution! |
Thank you for your contribution! |
# Conflicts: # build_test.mk # quantum/encoder.c # quantum/split_common/transport.c # testlist.mk
After months, I have updated my branch today. Could this please be reopened? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only real request for change is to make sure all the C/CPP/H files have GPL2+ copyright headers.
#define ENCODERS_PAD_A { } | ||
#define ENCODERS_PAD_B { } | ||
#define ENCODER_RESOLUTIONS { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'd prefer to explicitly require both sides in definitions, if an asymmetrical encoder setup is defined.
So you could do the #ifdef
, but I'm not sure it's the most readable/understandable/maintainable.
So yeah, my vote would be both:
// only right
#define ENCODERS_PAD_A { }
#define ENCODERS_PAD_A { }
#define ENCODERS_PAD_A_RIGHT { X }
#define ENCODERS_PAD_A_RIGHT { Y }
// only left
#define ENCODERS_PAD_A { X }
#define ENCODERS_PAD_A { Y }
#define ENCODERS_PAD_A_RIGHT { }
#define ENCODERS_PAD_A_RIGHT { }
have a couple of merge conflicts. |
Fixed the merge conflicts, however tests are currently failing. @BalzGuenat would you mind investigating with a |
Merged with develop to ensure the unit test workflow executes on CI. |
Fixed the tests. The callback override didn't work anymore since the signature changed in #12805. |
Unfortunately, this looks like it broke a bunch of the encoder boards with:
And other errors. |
Just a heads up, this seems to have caused a bug during initialization. Eg, it spams encoder updates until the board has normalized. |
…)" This reverts commit 32215d5.
Description
This allows asymmetric split keyboards to have a different number of encoders on each half.
Previously, the code assumed an equal number of encoders, even if they were wired differently.
This should be fully backwards compatible.
Types of Changes
Issues Fixed or Closed by This PR
Checklist
I will fix the code style while I wait for comments. I would appreciate some help with testing this, as I only know how to test this on hardware.
P.S.: Not sure if this counts as a core PR...