auto-sync
This commit is contained in:
parent
3b144f51cf
commit
2439d051e8
|
@ -53,7 +53,10 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->tunerStudioSerialSpeed = 57600;
|
||||
engineConfiguration->rpmHardLimit = 7000;
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
||||
boardConfiguration->analogChartMode = AC_TRIGGER;
|
||||
|
||||
// for best performance at high RPM, we need to turn off 'Engine Sniffer' and 'Sensor Sniffer'
|
||||
boardConfiguration->analogChartMode = AC_OFF;
|
||||
engineConfiguration->isDigitalChartEnabled = false;
|
||||
|
||||
engineConfiguration->isCylinderCleanupEnabled = false;
|
||||
engineConfiguration->isInjectionEnabled = true;
|
||||
|
|
|
@ -53,6 +53,7 @@ static const ignition_table_t defaultIatTiming = {
|
|||
};
|
||||
|
||||
float getBaseAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
||||
engine->m.beforeAdvance = GET_TIMESTAMP();
|
||||
if (cisnan(engineLoad)) {
|
||||
warning(OBD_PCM_Processor_Fault, "NaN engine load");
|
||||
return NAN;
|
||||
|
@ -64,7 +65,6 @@ float getBaseAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
float iatCorrection = iatAdvanceCorrectionMap.getValue(engine->engineState.clt, (float) rpm);
|
||||
|
||||
engine->m.beforeAdvance = GET_TIMESTAMP();
|
||||
float result = advanceMap.getValue(engineLoad, (float) rpm) + iatCorrection;
|
||||
engine->m.advanceTime = GET_TIMESTAMP() - engine->m.beforeAdvance;
|
||||
return result;
|
||||
|
|
|
@ -114,6 +114,15 @@ typedef struct {
|
|||
|
||||
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 Engine;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "efilib2.h"
|
||||
#include "map.h"
|
||||
|
||||
#if EFI_MAP_AVERAGING || defined(__DOXYGEN__)
|
||||
|
@ -163,7 +163,7 @@ static void endAveraging(void *arg) {
|
|||
*/
|
||||
static void mapAveragingCallback(trigger_event_e ckpEventType, uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
||||
// this callback is invoked on interrupt thread
|
||||
|
||||
engine->m.beforeMapAveragingCb = GET_TIMESTAMP();
|
||||
if (index != 0)
|
||||
return;
|
||||
|
||||
|
@ -187,6 +187,7 @@ static void mapAveragingCallback(trigger_event_e ckpEventType, uint32_t index DE
|
|||
// todo: schedule this based on closest trigger event, same as ignition works
|
||||
scheduleByAngle(rpm, &startTimer[structIndex], samplingStart, startAveraging, NULL);
|
||||
scheduleByAngle(rpm, &endTimer[structIndex], samplingStart + samplingDuration, endAveraging, NULL);
|
||||
engine->m.mapAveragingCbTime = GET_TIMESTAMP() - engine->m.beforeMapAveragingCb;
|
||||
}
|
||||
|
||||
static void showMapStats(void) {
|
||||
|
|
|
@ -139,6 +139,7 @@ bool isCranking(void) {
|
|||
void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
||||
RpmCalculator *rpmState = &engine->rpmCalculator;
|
||||
uint64_t nowNt = getTimeNowNt();
|
||||
engine->m.beforeRpmCb = GET_TIMESTAMP();
|
||||
#if EFI_PROD_CODE
|
||||
efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "lowstck#2z");
|
||||
#endif
|
||||
|
@ -176,6 +177,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index DECL
|
|||
if (boardConfiguration->analogChartMode == AC_TRIGGER)
|
||||
acAddData(getCrankshaftAngleNt(nowNt PASS_ENGINE_PARAMETER), index);
|
||||
#endif
|
||||
engine->m.rpmCbTime = GET_TIMESTAMP() - engine->m.beforeRpmCb;
|
||||
}
|
||||
|
||||
static scheduling_s tdcScheduler[2];
|
||||
|
|
|
@ -248,7 +248,8 @@ void triggerInfo(Engine *engine) {
|
|||
boolToString(engine->triggerShape.needSecondTriggerInput));
|
||||
scheduleMsg(logger, "expected duty #0=%f/#1=%f", ts->dutyCycle[0], ts->dutyCycle[1]);
|
||||
|
||||
scheduleMsg(logger, "isError %s/total errors=%d ord_err=%d/total revolutions=%d/self=%s",
|
||||
scheduleMsg(logger, "synchronizationNeeded=%s/isError=%s/total errors=%d ord_err=%d/total revolutions=%d/self=%s",
|
||||
boolToString(ts->isSynchronizationNeeded),
|
||||
boolToString(isTriggerDecoderError()), triggerCentral.triggerState.totalTriggerErrorCounter,
|
||||
triggerCentral.triggerState.orderingErrorCounter, triggerCentral.triggerState.getTotalRevolutionCounter(),
|
||||
boolToString(engineConfiguration->directSelfStimulation));
|
||||
|
@ -259,16 +260,7 @@ void triggerInfo(Engine *engine) {
|
|||
|
||||
#endif
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
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;
|
||||
|
||||
scheduleMsg(logger, "maxLockTime=%d / maxTriggerReentraint=%d", maxLockTime, maxTriggerReentraint);
|
||||
scheduleMsg(logger, "maxEventQueueTime=%d", maxEventQueueTime);
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
|
||||
scheduleMsg(logger, "primary trigger input: %s", hwPortname(boardConfiguration->triggerInputPins[0]));
|
||||
scheduleMsg(logger, "primary trigger simulator: %s %s freq=%d",
|
||||
|
@ -292,6 +284,27 @@ void triggerInfo(Engine *engine) {
|
|||
scheduleMsg(logger, "primary logic input: %s", hwPortname(boardConfiguration->logicAnalyzerPins[0]));
|
||||
scheduleMsg(logger, "secondary logic input: %s", hwPortname(boardConfiguration->logicAnalyzerPins[1]));
|
||||
|
||||
scheduleMsg(logger, "zeroTestTime=%d", engine->m.zeroTestTime);
|
||||
|
||||
scheduleMsg(logger, "advanceLookupTime=%d", engine->m.advanceTime);
|
||||
|
||||
scheduleMsg(logger,
|
||||
"ignitionMathTime=%d schTime=%d injectonSchTime=%d",
|
||||
engine->m.ignitionMathTime, engine->m.ignitionSchTime,
|
||||
engine->m.injectonSchTime);
|
||||
|
||||
scheduleMsg(logger, "mapTime=%d/hipTime=%d/rpmTime=%d",
|
||||
engine->m.mapAveragingCbTime,
|
||||
engine->m.hipCbTime,
|
||||
engine->m.rpmCbTime);
|
||||
|
||||
|
||||
scheduleMsg(logger, "maxLockTime=%d / maxTriggerReentraint=%d", maxLockTime, maxTriggerReentraint);
|
||||
scheduleMsg(logger, "maxEventQueueTime=%d", maxEventQueueTime);
|
||||
|
||||
scheduleMsg(logger, "totalTriggerHandlerMaxTime=%d", triggerMaxDuration);
|
||||
triggerMaxDuration = 0;
|
||||
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "hip9011_lookup.h"
|
||||
#include "HIP9011.h"
|
||||
#include "adc_inputs.h"
|
||||
#include "efilib2.h"
|
||||
|
||||
#if EFI_HIP_9011 || defined(__DOXYGEN__)
|
||||
|
||||
|
@ -161,7 +162,7 @@ static void endIntegration(void) {
|
|||
*/
|
||||
static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
||||
// this callback is invoked on interrupt thread
|
||||
|
||||
engine->m.beforeHipCb = GET_TIMESTAMP();
|
||||
if (index != 0)
|
||||
return;
|
||||
|
||||
|
@ -176,6 +177,7 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index DECLARE
|
|||
scheduleByAngle(rpm, &endTimer[structIndex], engineConfiguration->knockDetectionWindowEnd,
|
||||
(schfunc_t) &endIntegration,
|
||||
NULL);
|
||||
engine->m.hipCbTime = GET_TIMESTAMP() - engine->m.beforeHipCb;
|
||||
}
|
||||
|
||||
static void setGain(float value) {
|
||||
|
|
Loading…
Reference in New Issue