Only allow manual +/- if in manual range
This commit is contained in:
parent
48a658fff9
commit
649e7cf149
|
@ -96,7 +96,7 @@ void GenericGearController::update() {
|
|||
setDesiredGear(NEUTRAL);
|
||||
break;
|
||||
case SelectedGear::ManualPlus :
|
||||
if (!shiftTimer.hasElapsedMs(500)) {
|
||||
if (!shiftTimer.hasElapsedMs(500) || lastRange != SelectedGear::Manual) {
|
||||
break;
|
||||
}
|
||||
shiftTimer.reset();
|
||||
|
@ -115,7 +115,7 @@ void GenericGearController::update() {
|
|||
}
|
||||
break;
|
||||
case SelectedGear::ManualMinus :
|
||||
if (!shiftTimer.hasElapsedMs(500)) {
|
||||
if (!shiftTimer.hasElapsedMs(500) || lastRange != SelectedGear::Manual) {
|
||||
break;
|
||||
}
|
||||
shiftTimer.reset();
|
||||
|
@ -139,6 +139,8 @@ void GenericGearController::update() {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
lastRange = gear;
|
||||
}
|
||||
|
||||
GearControllerBase::update();
|
||||
|
|
|
@ -15,6 +15,7 @@ public:
|
|||
}
|
||||
private:
|
||||
Timer shiftTimer;
|
||||
SelectedGear lastRange;
|
||||
bool isNearest(float value, int pinIndex, float* rangeStates);
|
||||
SensorType getAnalogSensorType(int zeroBasedSensorIndex);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue