Skip to content

Fix #2 - Using buttons with multiple encoders#15

Merged
0xPIT merged 1 commit into
0xPIT:masterfrom
ToeKnee:master
May 2, 2017
Merged

Fix #2 - Using buttons with multiple encoders#15
0xPIT merged 1 commit into
0xPIT:masterfrom
ToeKnee:master

Conversation

@ToeKnee
Copy link
Copy Markdown
Contributor

@ToeKnee ToeKnee commented Feb 6, 2017

Move static variable into header file to fix handling of multiple rotary
encoders with buttons.

Move static variable into header file to fix handling of multiple rotary
encoders with buttons.
@soligen2010
Copy link
Copy Markdown

Just a FYI, this fix and other bug fixes and enhancements are in the soligen2010 fork.

@0xPIT
Copy link
Copy Markdown
Owner

0xPIT commented May 2, 2017

Hi, thanks for your PR.

Can you help me understand how extending the scope from function to class would fix the issue you seem to be having?

As each encoder should have it's own instance of the class, and thus the function, this should not change behaviour.

Thanks.

@soligen2010
Copy link
Copy Markdown

I am afraid you are mistaken. A static variable exists only once, and all objects will share it. It needs to be in the header file as either public/private/protected in the class definition for each to have it's own version.

@0xPIT
Copy link
Copy Markdown
Owner

0xPIT commented May 2, 2017

Of course, you are right, should not write comments when I don't have time to think first.

@0xPIT 0xPIT merged commit d6d5738 into 0xPIT:master May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants