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);
|
setDesiredGear(NEUTRAL);
|
||||||
break;
|
break;
|
||||||
case SelectedGear::ManualPlus :
|
case SelectedGear::ManualPlus :
|
||||||
if (!shiftTimer.hasElapsedMs(500)) {
|
if (!shiftTimer.hasElapsedMs(500) || lastRange != SelectedGear::Manual) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
shiftTimer.reset();
|
shiftTimer.reset();
|
||||||
|
@ -115,7 +115,7 @@ void GenericGearController::update() {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SelectedGear::ManualMinus :
|
case SelectedGear::ManualMinus :
|
||||||
if (!shiftTimer.hasElapsedMs(500)) {
|
if (!shiftTimer.hasElapsedMs(500) || lastRange != SelectedGear::Manual) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
shiftTimer.reset();
|
shiftTimer.reset();
|
||||||
|
@ -139,6 +139,8 @@ void GenericGearController::update() {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastRange = gear;
|
||||||
}
|
}
|
||||||
|
|
||||||
GearControllerBase::update();
|
GearControllerBase::update();
|
||||||
|
|
|
@ -15,6 +15,7 @@ public:
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
Timer shiftTimer;
|
Timer shiftTimer;
|
||||||
|
SelectedGear lastRange;
|
||||||
bool isNearest(float value, int pinIndex, float* rangeStates);
|
bool isNearest(float value, int pinIndex, float* rangeStates);
|
||||||
SensorType getAnalogSensorType(int zeroBasedSensorIndex);
|
SensorType getAnalogSensorType(int zeroBasedSensorIndex);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue