GDI4 overlap factor #5416

only: extract method
This commit is contained in:
Andrey 2023-07-20 15:40:10 -04:00
parent cce7991e37
commit 13d4475986
3 changed files with 8 additions and 2 deletions

View File

@ -585,7 +585,7 @@ bool validateConfig() {
ensureArrayIsAscending("Pedal map pedal", config->pedalToTpsPedalBins);
ensureArrayIsAscending("Pedal map RPM", config->pedalToTpsRpmBins);
if (engineConfiguration->hpfpCamLobes > 0) {
if (isGdiEngine()) {
ensureArrayIsAscending("HPFP compensation", engineConfiguration->hpfpCompensationRpmBins);
ensureArrayIsAscending("HPFP deadtime", engineConfiguration->hpfpDeadtimeVoltsBins);
ensureArrayIsAscending("HPFP lobe profile", engineConfiguration->hpfpLobeProfileQuantityBins);

View File

@ -150,12 +150,16 @@ angle_t HpfpQuantity::pumpAngleFuel(int rpm, HpfpController *model) {
engineConfiguration->hpfpLobeProfileAngle);
}
bool isGdiEngine() {
return engineConfiguration->hpfpCamLobes > 0;
}
void HpfpController::onFastCallback() {
// Pressure current/target calculation
int rpm = Sensor::getOrZero(SensorType::Rpm);
isHpfpInactive = rpm < rpm_spinning_cutoff ||
engineConfiguration->hpfpCamLobes == 0 ||
!isGdiEngine() ||
engineConfiguration->hpfpPumpVolume == 0 ||
!enginePins.hpfpValve.isInitialized();
// What conditions can we not handle?

View File

@ -31,6 +31,8 @@ public:
angle_t findNextLobe(); ///< Calculate the angle (after crank TDC) for the top of the next lobe
};
bool isGdiEngine();
class HpfpController;
class HpfpQuantity {