auto-sync
This commit is contained in:
parent
d9563ed54d
commit
8aa1f4d02f
|
@ -246,7 +246,7 @@ static void printState(void) {
|
||||||
debugFloat(&logger, "fuel_base", baseFuel, 2);
|
debugFloat(&logger, "fuel_base", baseFuel, 2);
|
||||||
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
|
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
|
||||||
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
|
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
|
||||||
debugFloat(&logger, "fuel_lag", getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER), 2);
|
debugFloat(&logger, "fuel_lag", engine->injectorLagMs, 2);
|
||||||
debugFloat(&logger, "fuel", getFuelMs(rpm PASS_ENGINE_PARAMETER), 2);
|
debugFloat(&logger, "fuel", getFuelMs(rpm PASS_ENGINE_PARAMETER), 2);
|
||||||
|
|
||||||
debugFloat(&logger, "timing", getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER), 2);
|
debugFloat(&logger, "timing", getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER), 2);
|
||||||
|
@ -395,9 +395,9 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
||||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(PASS_ENGINE_PARAMETER_F));
|
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(PASS_ENGINE_PARAMETER_F));
|
||||||
|
|
||||||
if (engine->rpmCalculator.isRunning()) {
|
if (engine->rpmCalculator.isRunning()) {
|
||||||
float iatCorrection = getIatCorrection(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER);
|
float iatCorrection = engine->engineState.iatFuelCorrection;
|
||||||
float cltCorrection = getCltCorrection(getCoolantTemperature(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER);
|
float cltCorrection = engine->engineState.cltFuelCorrection;
|
||||||
float injectorLag = getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER);
|
float injectorLag = engine->injectorLagMs;
|
||||||
scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad);
|
scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad);
|
||||||
scheduleMsg(&logger2, "baseFuel=%f", baseFuelMs);
|
scheduleMsg(&logger2, "baseFuel=%f", baseFuelMs);
|
||||||
|
|
||||||
|
@ -607,7 +607,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
||||||
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake);
|
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake);
|
||||||
float timing = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
|
float timing = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER);
|
||||||
tsOutputChannels->ignitionAdvance = timing > 360 ? timing - 720 : timing;
|
tsOutputChannels->ignitionAdvance = timing > 360 ? timing - 720 : timing;
|
||||||
tsOutputChannels->sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER);
|
tsOutputChannels->sparkDwell = ENGINE(engineState.sparkDwell);
|
||||||
tsOutputChannels->baseFuel = baseFuelMs;
|
tsOutputChannels->baseFuel = baseFuelMs;
|
||||||
tsOutputChannels->pulseWidthMs = getFuelMs(rpm PASS_ENGINE_PARAMETER);
|
tsOutputChannels->pulseWidthMs = getFuelMs(rpm PASS_ENGINE_PARAMETER);
|
||||||
tsOutputChannels->crankingFuelMs = getCrankingFuel(PASS_ENGINE_PARAMETER_F);
|
tsOutputChannels->crankingFuelMs = getCrankingFuel(PASS_ENGINE_PARAMETER_F);
|
||||||
|
|
|
@ -164,6 +164,9 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
|
||||||
engineState.sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER);
|
engineState.sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER);
|
||||||
dwellAngle = engineState.sparkDwell / getOneDegreeTimeMs(rpm);
|
dwellAngle = engineState.sparkDwell / getOneDegreeTimeMs(rpm);
|
||||||
|
|
||||||
|
engine->engineState.iatFuelCorrection = getIatCorrection(engine->engineState.iat PASS_ENGINE_PARAMETER);
|
||||||
|
engine->engineState.cltFuelCorrection = getCltCorrection(engine->engineState.clt PASS_ENGINE_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
StartupFuelPumping::StartupFuelPumping() {
|
StartupFuelPumping::StartupFuelPumping() {
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "algo.h"
|
#include "algo.h"
|
||||||
#include "LocalVersionHolder.h"
|
#include "LocalVersionHolder.h"
|
||||||
#include "alternatorController.h"
|
#include "alternatorController.h"
|
||||||
|
#include "fuel_math.h"
|
||||||
|
|
||||||
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
||||||
#include "AdcConfiguration.h"
|
#include "AdcConfiguration.h"
|
||||||
|
@ -226,7 +227,7 @@ static void periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
engine->engineState.mapAveragingDuration = NAN;
|
engine->engineState.mapAveragingDuration = NAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
engine->engineState.sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER);
|
engine->periodicFastCallback();
|
||||||
|
|
||||||
chVTSetAny(&periodicFastTimer, 20 * TICKS_IN_MS, (vtfunc_t) &periodicFastCallback, engine);
|
chVTSetAny(&periodicFastTimer, 20 * TICKS_IN_MS, (vtfunc_t) &periodicFastCallback, engine);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue