Revert "gear ratio can't be negative, it's unsigned"

This reverts commit 37bf5400f7.
This commit is contained in:
Matthew Kennedy 2023-03-17 14:43:27 -07:00
parent 7e98c6fed3
commit acbabe8387
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,14 @@ void GearDetector::onConfigurationChange(engine_configuration_s const * /*previo
return;
}
// validate gears
for (size_t i = 0; i < gearCount; i++) {
if (engineConfiguration->gearRatio[i] <= 0) {
firmwareError(OBD_PCM_Processor_Fault, "Invalid gear ratio for #%d", i + 1);
return;
}
}
for (int i = 0; i < gearCount - 1; i++) {
// Threshold i is the threshold between gears i and i+1
float gearI = engineConfiguration->gearRatio[i];