diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index c493cdadaf..77528a41d0 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -194,8 +194,10 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) { */ engine->engineState.currentVE = veMap.getValue(map, rpm) * 0.01; engine->engineState.targerAFR = afrMap.getValue(map, rpm); + } else { + float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F); + engine->engineState.baseTableFuel = getBaseTableFuel(engineConfiguration, rpm, engineLoad); } - } StartupFuelPumping::StartupFuelPumping() { diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index ae6431be8c..fdf63bdf19 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -97,6 +97,8 @@ public: float currentVE; float targerAFR; + float baseTableFuel; + angle_t injectionAngle; }; diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index a245c2427b..376a9b8fb9 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -22,6 +22,9 @@ */ #include "main.h" +#if EFI_PROD_CODE +#include +#endif #if !EFI_PROD_CODE && !EFI_SIMULATOR @@ -293,6 +296,13 @@ static void ignitionCalc(int rpm DECLARE_ENGINE_PARAMETER_S) { engine->advance = -ENGINE(engineState.timingAdvance); } +#if EFI_PROD_CODE +/** + * this field is used as an Expression in IAR debugger + */ +uint32_t *cyccnt = (uint32_t*)&DWT_CYCCNT; +#endif + /** * This is the main trigger event handler. * Both injection and ignition are controlled from this method. diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 3a44b417d1..88146227b8 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -230,6 +230,7 @@ extern uint32_t hipLastExecutionCount; extern uint32_t hwSetTimerTime; extern int maxHowFarOff; +extern uint32_t *cyccnt; void triggerInfo(Engine *engine) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) @@ -294,7 +295,9 @@ void triggerInfo(Engine *engine) { scheduleMsg(logger, "zeroTestTime=%d maxHowFarOff=%d", engine->m.zeroTestTime, maxHowFarOff); maxHowFarOff = 0; - scheduleMsg(logger, "advanceLookupTime=%d", engine->m.advanceLookupTime); + scheduleMsg(logger, "advanceLookupTime=%d t=%d fuelCalcTime=%d", + engine->m.advanceLookupTime, *cyccnt, + engine->m.fuelCalcTime); scheduleMsg(logger, "ignitionMathTime=%d ignitionSchTime=%d injectonSchTime=%d",