only:Lamborghini Diablo 1995 CKP Pattern #5876

This commit is contained in:
Andrey 2024-01-15 20:36:44 -05:00
parent 244a42d795
commit 249178cb49
2 changed files with 18 additions and 6 deletions

View File

@ -110,9 +110,12 @@ angle_t TriggerWaveform::getCycleDuration() const {
case FOUR_STROKE_CRANK_SENSOR:
case TWO_STROKE:
return TWO_STROKE_CYCLE_DURATION;
default:
case OM_NONE:
case FOUR_STROKE_CAM_SENSOR:
return FOUR_STROKE_CYCLE_DURATION;
}
criticalError("unreachable getCycleDuration");
return 0;
}
bool TriggerWaveform::needsDisambiguation() const {
@ -120,15 +123,17 @@ bool TriggerWaveform::needsDisambiguation() const {
case FOUR_STROKE_CRANK_SENSOR:
case FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR:
case FOUR_STROKE_THREE_TIMES_CRANK_SENSOR:
case FOUR_STROKE_SIX_TIMES_CRANK_SENSOR:
case FOUR_STROKE_TWELVE_TIMES_CRANK_SENSOR:
return true;
case FOUR_STROKE_CAM_SENSOR:
case TWO_STROKE:
case OM_NONE:
return false;
default:
criticalError("bad operationMode() in needsDisambiguation");
return true;
/* let's NOT handle default in order to benefit from -Werror=switch */
}
criticalError("unreachable needsDisambiguation");
return true;
}
/**
@ -712,7 +717,7 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
break;
case trigger_type_e::TT_6_TOOTH_CRANK:
configure3ToothCrank(this);
configure6ToothCrank(this);
break;
case trigger_type_e::TT_12_TOOTH_CRANK:

View File

@ -108,12 +108,19 @@ int getCrankDivider(operation_mode_e operationMode) {
return SYMMETRICAL_SIX_TIMES_CRANK_SENSOR_DIVIDER;
case FOUR_STROKE_TWELVE_TIMES_CRANK_SENSOR:
return SYMMETRICAL_TWELVE_TIMES_CRANK_SENSOR_DIVIDER;
default:
case OM_NONE:
case FOUR_STROKE_CAM_SENSOR:
case TWO_STROKE:
// That's easy - trigger cycle matches engine cycle
return 1;
/* let's NOT handle default in order to benefit from -Werror=switch */
}
/**
wow even while we explicitly handle all enumerations in the switch above we still need a return statement due to
https://stackoverflow.com/questions/34112483/gcc-how-best-to-handle-warning-about-unreachable-end-of-function-after-switch
*/
criticalError("unreachable getCrankDivider");
return 1;
}
static bool vvtWithRealDecoder(vvt_mode_e vvtMode) {