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

[TCU] Button Shifting #1750

Merged
merged 3 commits into from Sep 3, 2020
Merged

Conversation

chuckwagoncomputing
Copy link
Member

No description provided.

setDesiredGear(NEUTRAL);
break;
case NEUTRAL:
setDesiredGear(GEAR_1);
Copy link
Contributor

Choose a reason for hiding this comment

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

we will soon have 8 gears, this would looks a bit nasty

we probably need gear_8 enum, a property for gears count, and less copy-paste next/previous implementation?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah. also a real world car won't let the driver switch from neutral to 1st gear with the paddle shifters

Copy link
Contributor

Choose a reason for hiding this comment

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

well this is more like "return DESIRED gear" vs "current gear"

"desired" we can blip from 2 to 5

Copy link
Member Author

Choose a reason for hiding this comment

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

In other words, in the real world reverse, neutral, and 1st gear at least will be special cases. I could have implemented a simple increment/decrement with a gear count property, but I figured an example that could be easily modified to use in a real-world scenario would be better than one that had to be completely rewritten.

@rusefillc rusefillc merged commit b8838de into rusefi:master Sep 3, 2020
@chuckwagoncomputing chuckwagoncomputing deleted the tcu-button-shift branch September 6, 2020 21:28
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.

None yet

2 participants