parent
5bf6964538
commit
d61e1b5147
|
@ -144,7 +144,7 @@ void EngineState::periodicFastCallback() {
|
|||
}
|
||||
engine->fuelComputer.running.postCrankingFuelCorrection = m_postCrankingFactor;
|
||||
|
||||
engine->ignitionState.cltTimingCorrection = getCltTimingCorrection();
|
||||
engine->ignitionState.updateAdvanceCorrections();
|
||||
|
||||
baroCorrection = getBaroCorrection();
|
||||
|
||||
|
|
|
@ -366,15 +366,6 @@ float getCltFuelCorrection() {
|
|||
return interpolate2d(clt.Value, config->cltFuelCorrBins, config->cltFuelCorr);
|
||||
}
|
||||
|
||||
angle_t getCltTimingCorrection() {
|
||||
const auto clt = Sensor::get(SensorType::Clt);
|
||||
|
||||
if (!clt)
|
||||
return 0; // this error should be already reported somewhere else, let's just handle it
|
||||
|
||||
return interpolate2d(clt.Value, config->cltTimingBins, config->cltTimingExtra);
|
||||
}
|
||||
|
||||
float getIatFuelCorrection() {
|
||||
const auto iat = Sensor::get(SensorType::Iat);
|
||||
|
||||
|
|
|
@ -130,6 +130,19 @@ angle_t getRunningAdvance(float rpm, float engineLoad) {
|
|||
return advanceAngle;
|
||||
}
|
||||
|
||||
angle_t getCltTimingCorrection() {
|
||||
const auto clt = Sensor::get(SensorType::Clt);
|
||||
|
||||
if (!clt)
|
||||
return 0; // this error should be already reported somewhere else, let's just handle it
|
||||
|
||||
return interpolate2d(clt.Value, config->cltTimingBins, config->cltTimingExtra);
|
||||
}
|
||||
|
||||
void IgnitionState::updateAdvanceCorrections() {
|
||||
cltTimingCorrection = getCltTimingCorrection();
|
||||
}
|
||||
|
||||
angle_t getAdvanceCorrections(float engineLoad) {
|
||||
auto iat = Sensor::get(SensorType::Iat);
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
class IgnitionState : public ignition_state_s {
|
||||
public:
|
||||
void updateDwell(float rpm, bool isCranking);
|
||||
void updateAdvanceCorrections();
|
||||
|
||||
floatms_t getDwell() const;
|
||||
angle_t getWrappedAdvance(const float rpm, const float engineLoad);
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue