-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix default pin assignement for unassigned buttons, take 2 #4098
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
Conversation
|
If you want to do it, do it correctly. |
While as always I truly appreciate the help and guidance, there's no need to be rude to people trying to help, so you could have done without the first sentence. I spent a long time testing the code block you linked and could never get it to trigger for reasons beyond my understanding. I asked in the Discord and got no answers. So I did the next best thing I could think of, found where that behavior was implemented in the previous release and placed the code there. If you look at the block you quoted, if it was to trigger the fix I implemented should not be needed since one of the conditions to set btnPin to -1 is buttonType[s] == BTN_TYPE_NONE. If the block above should always be triggered on first boot and it's not due to a bug, it's obviously better to figure out why that is rather than patch the code somewhere else, so I'm willing to look into that instead. |
|
Can one of the reviewers please approve if this it ready to merge (and cherry pick to the release branch) ? |
|
My language may not be the best but my intentions are always good. Although this PR may be a workaround, I've managed to pinpoint the cause of the issue (incorrect button assignment at 1st boot). |
|
@blazoncek did you fix this elsewhere? can this be closed? |
|
I have unlimited and truly variable button support with correct 1st boot initialisation ready in my fork. |
blazoncek
left a comment
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.
Even though this fix should be ok, I would prefer #4757 being implemented instead.
Same |
Follow up on #3953
Fill btnPin array with -1 unless corresponding member of buttonType array has been set to a value != 0 (BTN_TYPE_NONE).
0.14 branch had a similar implementation where it filled all elements except the first with -1, but since in 0.15 you can define multiple button pins at compile time it was removed.
Because of this change it is no longer necessary to specify the second pin and type on the default BTNPIN and BTNTYPE defs.
Credit to @softhack007 for the idea.