Remove old monitoring timestamps (#1217)
* remove monitoring timestamps * adv map * fuel calc * map avg * printing * spark logic * hip 9011 * new traces * s * missed a few
This commit is contained in:
parent
9e125ecbdf
commit
2c809e4475
|
@ -84,8 +84,6 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
||||||
}
|
}
|
||||||
|
|
||||||
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(engineLoad), "invalid el", NAN);
|
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(engineLoad), "invalid el", NAN);
|
||||||
engine->m.beforeZeroTest = getTimeNowLowerNt();
|
|
||||||
engine->m.zeroTestTime = getTimeNowLowerNt() - engine->m.beforeZeroTest;
|
|
||||||
|
|
||||||
float advanceAngle;
|
float advanceAngle;
|
||||||
if (CONFIG(useTPSAdvanceTable)) {
|
if (CONFIG(useTPSAdvanceTable)) {
|
||||||
|
|
|
@ -225,8 +225,6 @@ void Engine::reset() {
|
||||||
*/
|
*/
|
||||||
engineCycle = getEngineCycle(FOUR_STROKE_CRANK_SENSOR);
|
engineCycle = getEngineCycle(FOUR_STROKE_CRANK_SENSOR);
|
||||||
memset(&ignitionPin, 0, sizeof(ignitionPin));
|
memset(&ignitionPin, 0, sizeof(ignitionPin));
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -488,11 +486,9 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
engine->m.beforeFuelCalc = getTimeNowLowerNt();
|
|
||||||
int rpm = GET_RPM();
|
int rpm = GET_RPM();
|
||||||
|
|
||||||
ENGINE(injectionDuration) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
ENGINE(injectionDuration) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
engine->m.fuelCalcTime = getTimeNowLowerNt() - engine->m.beforeFuelCalc;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -322,8 +322,6 @@ public:
|
||||||
*/
|
*/
|
||||||
bool isInShutdownMode() const;
|
bool isInShutdownMode() const;
|
||||||
|
|
||||||
monitoring_timestamps_s m;
|
|
||||||
|
|
||||||
void knockLogic(float knockVolts DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void knockLogic(float knockVolts DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void printKnockState(void);
|
void printKnockState(void);
|
||||||
|
|
||||||
|
|
|
@ -105,35 +105,6 @@ public:
|
||||||
cyclic_buffer<int, 8> recentWarnings;
|
cyclic_buffer<int, 8> recentWarnings;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t beforeMainTrigger;
|
|
||||||
uint32_t mainTriggerCallbackTime;
|
|
||||||
|
|
||||||
uint32_t beforeIgnitionSch;
|
|
||||||
uint32_t ignitionSchTime;
|
|
||||||
|
|
||||||
uint32_t beforeInjectonSch;
|
|
||||||
uint32_t injectonSchTime;
|
|
||||||
|
|
||||||
uint32_t beforeZeroTest;
|
|
||||||
uint32_t zeroTestTime;
|
|
||||||
|
|
||||||
uint32_t beforeAdvance;
|
|
||||||
uint32_t advanceLookupTime;
|
|
||||||
|
|
||||||
uint32_t beforeFuelCalc;
|
|
||||||
uint32_t fuelCalcTime;
|
|
||||||
|
|
||||||
uint32_t beforeMapAveragingCb;
|
|
||||||
uint32_t mapAveragingCbTime;
|
|
||||||
|
|
||||||
uint32_t beforeHipCb;
|
|
||||||
uint32_t hipCbTime;
|
|
||||||
|
|
||||||
uint32_t beforeRpmCb;
|
|
||||||
uint32_t rpmCbTime;
|
|
||||||
} monitoring_timestamps_s;
|
|
||||||
|
|
||||||
class FsioState {
|
class FsioState {
|
||||||
public:
|
public:
|
||||||
FsioState();
|
FsioState();
|
||||||
|
|
|
@ -359,7 +359,6 @@ static void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEvent
|
||||||
|
|
||||||
(void) ckpSignalType;
|
(void) ckpSignalType;
|
||||||
|
|
||||||
ENGINE(m.beforeMainTrigger) = getTimeNowLowerNt();
|
|
||||||
if (hasFirmwareError()) {
|
if (hasFirmwareError()) {
|
||||||
/**
|
/**
|
||||||
* In case on a major error we should not process any more events.
|
* In case on a major error we should not process any more events.
|
||||||
|
@ -450,10 +449,6 @@ static void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEvent
|
||||||
* For spark we schedule both start of coil charge and actual spark based on trigger angle
|
* For spark we schedule both start of coil charge and actual spark based on trigger angle
|
||||||
*/
|
*/
|
||||||
onTriggerEventSparkLogic(limitedSpark, trgEventIndex, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX);
|
onTriggerEventSparkLogic(limitedSpark, trgEventIndex, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
if (trgEventIndex == 0) {
|
|
||||||
ENGINE(m.mainTriggerCallbackTime) = getTimeNowLowerNt() - ENGINE(m.beforeMainTrigger);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the engine is not stopped or cylinder cleanup is activated
|
// Check if the engine is not stopped or cylinder cleanup is activated
|
||||||
|
|
|
@ -273,7 +273,6 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
|
||||||
if (index != (uint32_t)CONFIG(mapAveragingSchedulingAtIndex))
|
if (index != (uint32_t)CONFIG(mapAveragingSchedulingAtIndex))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
engine->m.beforeMapAveragingCb = getTimeNowLowerNt();
|
|
||||||
int rpm = GET_RPM_VALUE;
|
int rpm = GET_RPM_VALUE;
|
||||||
if (!isValidRpm(rpm)) {
|
if (!isValidRpm(rpm)) {
|
||||||
return;
|
return;
|
||||||
|
@ -317,8 +316,6 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
|
||||||
startAveraging PASS_ENGINE_PARAMETER_SUFFIX);
|
startAveraging PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
scheduleByAngle(&endTimer[i][structIndex], edgeTimestamp, samplingEnd,
|
scheduleByAngle(&endTimer[i][structIndex], edgeTimestamp, samplingEnd,
|
||||||
endAveraging PASS_ENGINE_PARAMETER_SUFFIX);
|
endAveraging PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
engine->m.mapAveragingCbTime = getTimeNowLowerNt()
|
|
||||||
- engine->m.beforeMapAveragingCb;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,8 +233,6 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
|
||||||
RpmCalculator *rpmState = &engine->rpmCalculator;
|
RpmCalculator *rpmState = &engine->rpmCalculator;
|
||||||
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
ENGINE(m.beforeRpmCb) = getTimeNowLowerNt();
|
|
||||||
|
|
||||||
bool hadRpmRecently = rpmState->checkIfSpinning(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
|
bool hadRpmRecently = rpmState->checkIfSpinning(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
if (hadRpmRecently) {
|
if (hadRpmRecently) {
|
||||||
|
@ -256,7 +254,6 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
|
||||||
}
|
}
|
||||||
rpmState->onNewEngineCycle();
|
rpmState->onNewEngineCycle();
|
||||||
rpmState->lastRpmEventTimeNt = nowNt;
|
rpmState->lastRpmEventTimeNt = nowNt;
|
||||||
ENGINE(m.rpmCbTime) = getTimeNowLowerNt() - ENGINE(m.beforeRpmCb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -376,8 +376,8 @@ void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
ScopePerf perf(PE::PrepareIgnitionSchedule);
|
||||||
|
|
||||||
engine->m.beforeIgnitionSch = getTimeNowLowerNt();
|
|
||||||
/**
|
/**
|
||||||
* TODO: warning. there is a bit of a hack here, todo: improve.
|
* TODO: warning. there is a bit of a hack here, todo: improve.
|
||||||
* currently output signals/times dwellStartTimer from the previous revolutions could be
|
* currently output signals/times dwellStartTimer from the previous revolutions could be
|
||||||
|
@ -402,7 +402,6 @@ static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNA
|
||||||
// todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that
|
// todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that
|
||||||
|
|
||||||
initializeIgnitionActions(PASS_ENGINE_PARAMETER_SIGNATURE);
|
initializeIgnitionActions(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
engine->m.ignitionSchTime = getTimeNowLowerNt() - engine->m.beforeIgnitionSch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -597,22 +597,7 @@ void triggerInfo(void) {
|
||||||
scheduleMsg(logger, "primary logic input: %s", hwPortname(CONFIG(logicAnalyzerPins)[0]));
|
scheduleMsg(logger, "primary logic input: %s", hwPortname(CONFIG(logicAnalyzerPins)[0]));
|
||||||
scheduleMsg(logger, "secondary logic input: %s", hwPortname(CONFIG(logicAnalyzerPins)[1]));
|
scheduleMsg(logger, "secondary logic input: %s", hwPortname(CONFIG(logicAnalyzerPins)[1]));
|
||||||
|
|
||||||
scheduleMsg(logger, "zeroTestTime=%d maxSchedulingPrecisionLoss=%d", engine->m.zeroTestTime, maxSchedulingPrecisionLoss);
|
scheduleMsg(logger, "maxSchedulingPrecisionLoss=%d", maxSchedulingPrecisionLoss);
|
||||||
|
|
||||||
scheduleMsg(logger, "advanceLookupTime=%d now=%d fuelCalcTime=%d",
|
|
||||||
engine->m.advanceLookupTime, *cyccnt,
|
|
||||||
engine->m.fuelCalcTime);
|
|
||||||
|
|
||||||
scheduleMsg(logger,
|
|
||||||
"ignitionSchTime=%d injectonSchTime=%d",
|
|
||||||
engine->m.ignitionSchTime,
|
|
||||||
engine->m.injectonSchTime);
|
|
||||||
|
|
||||||
scheduleMsg(logger, "mapTime=%d/hipTime=%d/rpmTime=%d/mainTriggerCallbackTime=%d",
|
|
||||||
engine->m.mapAveragingCbTime,
|
|
||||||
engine->m.hipCbTime,
|
|
||||||
engine->m.rpmCbTime,
|
|
||||||
engine->m.mainTriggerCallbackTime);
|
|
||||||
|
|
||||||
#if EFI_CLOCK_LOCKS
|
#if EFI_CLOCK_LOCKS
|
||||||
scheduleMsg(logger, "maxLockedDuration=%d / maxTriggerReentraint=%d", maxLockedDuration, maxTriggerReentraint);
|
scheduleMsg(logger, "maxLockedDuration=%d / maxTriggerReentraint=%d", maxLockedDuration, maxTriggerReentraint);
|
||||||
|
|
|
@ -58,6 +58,8 @@ enum class PE : uint8_t {
|
||||||
Temporary3,
|
Temporary3,
|
||||||
Temporary4,
|
Temporary4,
|
||||||
EngineSniffer,
|
EngineSniffer,
|
||||||
|
PrepareIgnitionSchedule,
|
||||||
|
Hip9011IntHoldCallback,
|
||||||
// enum_end_tag
|
// enum_end_tag
|
||||||
// The tag above is consumed by PerfTraceTool.java
|
// The tag above is consumed by PerfTraceTool.java
|
||||||
// please note that the tool requires a comma at the end of last value
|
// please note that the tool requires a comma at the end of last value
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "hip9011_lookup.h"
|
#include "hip9011_lookup.h"
|
||||||
#include "hip9011.h"
|
#include "hip9011.h"
|
||||||
#include "adc_inputs.h"
|
#include "adc_inputs.h"
|
||||||
|
#include "perf_trace.h"
|
||||||
|
|
||||||
#include "engine_controller.h"
|
#include "engine_controller.h"
|
||||||
|
|
||||||
|
@ -253,7 +254,8 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index, efitic
|
||||||
// this callback is invoked on interrupt thread
|
// this callback is invoked on interrupt thread
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
return;
|
return;
|
||||||
engine->m.beforeHipCb = getTimeNowLowerNt();
|
|
||||||
|
ScopePerf perf(PE::Hip9011IntHoldCallback);
|
||||||
|
|
||||||
int rpm = GET_RPM_VALUE;
|
int rpm = GET_RPM_VALUE;
|
||||||
if (!isValidRpm(rpm))
|
if (!isValidRpm(rpm))
|
||||||
|
@ -268,7 +270,6 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index, efitic
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
scheduleByAngle(&endTimer[structIndex], edgeTimestamp, engineConfiguration->knockDetectionWindowEnd,
|
scheduleByAngle(&endTimer[structIndex], edgeTimestamp, engineConfiguration->knockDetectionWindowEnd,
|
||||||
&endIntegration);
|
&endIntegration);
|
||||||
engine->m.hipCbTime = getTimeNowLowerNt() - engine->m.beforeHipCb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMaxKnockSubDeg(int value) {
|
void setMaxKnockSubDeg(int value) {
|
||||||
|
|
Loading…
Reference in New Issue