auto-sync
This commit is contained in:
parent
555110df43
commit
192c439f0b
|
@ -21,9 +21,7 @@
|
|||
#include "main.h"
|
||||
#include "advance_map.h"
|
||||
#include "interpolation.h"
|
||||
// that's for 'max' function
|
||||
#include "idle_controller.h"
|
||||
|
||||
#include "efilib2.h"
|
||||
#include "engine_configuration.h"
|
||||
#include "engine_math.h"
|
||||
|
||||
|
@ -38,8 +36,14 @@ float getBaseAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
|||
}
|
||||
efiAssert(!cisnan(engineLoad), "invalid el", NAN);
|
||||
efiAssert(!cisnan(engineLoad), "invalid rpm", NAN);
|
||||
return advanceMap.getValue(engineLoad, engineConfiguration->ignitionLoadBins, (float) rpm,
|
||||
engine->m.beforeZeroTest = GET_TIMESTAMP();
|
||||
engine->m.zeroTestTime = GET_TIMESTAMP() - engine->m.beforeZeroTest;
|
||||
|
||||
engine->m.beforeAdvance = GET_TIMESTAMP();
|
||||
float result = advanceMap.getValue(engineLoad, engineConfiguration->ignitionLoadBins, (float) rpm,
|
||||
engineConfiguration->ignitionRpmBins);
|
||||
engine->m.advanceTime = GET_TIMESTAMP() - engine->m.beforeAdvance;
|
||||
return result;
|
||||
}
|
||||
|
||||
float getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||
|
|
|
@ -100,6 +100,12 @@ typedef struct {
|
|||
|
||||
uint32_t beforeInjectonSch;
|
||||
uint32_t injectonSchTime;
|
||||
|
||||
uint32_t beforeZeroTest;
|
||||
uint32_t zeroTestTime;
|
||||
|
||||
uint32_t beforeAdvance;
|
||||
uint32_t advanceTime;
|
||||
} monitoring_timestamps_s;
|
||||
|
||||
class Engine {
|
||||
|
|
|
@ -265,11 +265,13 @@ void triggerInfo(Engine *engine) {
|
|||
#endif
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
scheduleMsg(logger, "sn=%s ignitionMathTime=%d schTime=%d injectonSchTime=%d triggerMaxDuration=%d",
|
||||
scheduleMsg(logger, "sn=%s ignitionMathTime=%d schTime=%d injectonSchTime=%d zeroTestTime=%d advanceTime=%d triggerMaxDuration=%d",
|
||||
boolToString(ts->isSynchronizationNeeded),
|
||||
engine->m.ignitionMathTime,
|
||||
engine->m.ignitionSchTime,
|
||||
engine->m.injectonSchTime,
|
||||
engine->m.zeroTestTime,
|
||||
engine->m.advanceTime,
|
||||
triggerMaxDuration);
|
||||
|
||||
triggerMaxDuration = 0;
|
||||
|
|
Loading…
Reference in New Issue