Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool right_isTheMostRecentPressed = false;
- bool up_isTheMostRecentPressed = false;
- GCReport getGCReport(GpioToButtonSets::F1::ButtonSet buttonSet) {
- GpioToButtonSets::F1::ButtonSet bs = buttonSet; // Alterable copy
- GCReport gcReport = defaultGcReport;
- /* 2IP No reactivation */
- if (bs.right && !right_wasPressed) right_isTheMostRecentPressed=true;
- if (bs.left && !left_wasPressed) right_isTheMostRecentPressed=false;
- if (bs.up && !up_wasPressed) up_outlawUntilRelease=true;
- if (bs.down && !down_wasPressed) up_isTheMostRecentPressed=false;
- left_wasPressed = bs.left;
- right_wasPressed = bs.right;
- up_wasPressed = bs.up;
- down_wasPressed = bs.down;
- if (bs.left && bs.right) {
- if (right_isTheMostRecentPressed) bs.left = false;
- else bs.right = false;
- }
- if (bs.down && bs.up) {
- if (up_isTheMostRecentPressed) bs.down = false;
- else bs.up = false;
- }
Add Comment
Please, Sign In to add comment