static void triggerInfo(Engine *engine) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) trigger_shape_s *ts = &engine->triggerShape; scheduleMsg(&logger, "Template %s/%d trigger %d", getConfigurationName(engineConfiguration->engineType), engineConfiguration->engineType, engineConfiguration->triggerConfig.triggerType); scheduleMsg(&logger, "trigger event counters %d/%d/%d/%d", triggerCentral.getHwEventCounter(0), triggerCentral.getHwEventCounter(1), triggerCentral.getHwEventCounter(2), triggerCentral.getHwEventCounter(3)); scheduleMsg(&logger, "expected cycle events %d/%d/%d", ts->expectedEventCount[0], engine->triggerShape.expectedEventCount[1], ts->expectedEventCount[2]); scheduleMsg(&logger, "trigger type=%d/need2ndChannel=%s", engineConfiguration->triggerConfig.triggerType, boolToString(engineConfiguration->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", boolToString(isTriggerDecoderError()), triggerCentral.triggerState.totalTriggerErrorCounter, triggerCentral.triggerState.orderingErrorCounter, triggerCentral.triggerState.getTotalRevolutionCounter(), boolToString(engineConfiguration->directSelfStimulation)); #endif #if EFI_PROD_CODE scheduleMsg(&logger, "sn=%s ignitionMathTime=%d schTime=%d triggerMaxDuration=%d", boolToString(ts->isSynchronizationNeeded), engine->ignitionMathTime, engine->ignitionSchTime, triggerMaxDuration); triggerMaxDuration = 0; scheduleMsg(&logger, "maxLockTime=%d / maxTriggerReentraint=%d", maxLockTime, maxTriggerReentraint); scheduleMsg(&logger, "maxEventQueueTime=%d", maxEventQueueTime); scheduleMsg(&logger, "primary trigger simulator: %s %s freq=%d", hwPortname(boardConfiguration->triggerSimulatorPins[0]), pinModeToString(boardConfiguration->triggerSimulatorPinModes[0]), boardConfiguration->triggerSimulatorFrequency); scheduleMsg(&logger, "secondary trigger simulator: %s %s phase=%d", hwPortname(boardConfiguration->triggerSimulatorPins[1]), pinModeToString(boardConfiguration->triggerSimulatorPinModes[1]), triggerSignal.safe.phaseIndex); scheduleMsg(&logger, "3rd trigger simulator: %s %s", hwPortname(boardConfiguration->triggerSimulatorPins[2]), pinModeToString(boardConfiguration->triggerSimulatorPinModes[2])); scheduleMsg(&logger, "trigger error extra LED: %s %s", hwPortname(boardConfiguration->triggerErrorPin), pinModeToString(boardConfiguration->triggerErrorPinMode)); scheduleMsg(&logger, "primary trigger input: %s", hwPortname(boardConfiguration->triggerInputPins[0])); scheduleMsg(&logger, "secondary trigger input: %s", hwPortname(boardConfiguration->triggerInputPins[1])); scheduleMsg(&logger, "primary logic input: %s", hwPortname(boardConfiguration->logicAnalyzerPins[0])); scheduleMsg(&logger, "secondary logic input: %s", hwPortname(boardConfiguration->logicAnalyzerPins[1])); #endif /* EFI_PROD_CODE */ }
void triggerInfo(Engine *engine) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) TriggerShape *ts = &engine->triggerShape; scheduleMsg(logger, "Template %s (%d) trigger %s (%d) useRiseEdge=%s onlyFront=%s", getConfigurationName(engineConfiguration->engineType), engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type, boolToString(TRIGGER_SHAPE(useRiseEdge)), boolToString(engineConfiguration->useOnlyFrontForTrigger)); scheduleMsg(logger, "trigger#1 event counters up=%d/down=%d", triggerCentral.getHwEventCounter(0), triggerCentral.getHwEventCounter(1)); if (engine->triggerShape.needSecondTriggerInput) { scheduleMsg(logger, "trigger#2 event counters up=%d/down=%d", triggerCentral.getHwEventCounter(2), triggerCentral.getHwEventCounter(3)); } scheduleMsg(logger, "expected cycle events %d/%d/%d", ts->expectedEventCount[0], engine->triggerShape.expectedEventCount[1], ts->expectedEventCount[2]); scheduleMsg(logger, "trigger type=%d/need2ndChannel=%s", engineConfiguration->trigger.type, 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", boolToString(isTriggerDecoderError()), triggerCentral.triggerState.totalTriggerErrorCounter, triggerCentral.triggerState.orderingErrorCounter, triggerCentral.triggerState.getTotalRevolutionCounter(), boolToString(engineConfiguration->directSelfStimulation)); if (ts->isSynchronizationNeeded) { scheduleMsg(logger, "gap from %f to %f", ts->syncRatioFrom, ts->syncRatioTo); } #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); scheduleMsg(logger, "primary trigger input: %s", hwPortname(boardConfiguration->triggerInputPins[0])); scheduleMsg(logger, "primary trigger simulator: %s %s freq=%d", hwPortname(boardConfiguration->triggerSimulatorPins[0]), getPin_output_mode_e(boardConfiguration->triggerSimulatorPinModes[0]), boardConfiguration->triggerSimulatorFrequency); if (engine->triggerShape.needSecondTriggerInput) { scheduleMsg(logger, "secondary trigger input: %s", hwPortname(boardConfiguration->triggerInputPins[1])); #if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__) scheduleMsg(logger, "secondary trigger simulator: %s %s phase=%d", hwPortname(boardConfiguration->triggerSimulatorPins[1]), getPin_output_mode_e(boardConfiguration->triggerSimulatorPinModes[1]), triggerSignal.safe.phaseIndex); #endif /* EFI_EMULATE_POSITION_SENSORS */ } // scheduleMsg(logger, "3rd trigger simulator: %s %s", hwPortname(boardConfiguration->triggerSimulatorPins[2]), // getPin_output_mode_e(boardConfiguration->triggerSimulatorPinModes[2])); scheduleMsg(logger, "trigger error extra LED: %s %s", hwPortname(boardConfiguration->triggerErrorPin), getPin_output_mode_e(boardConfiguration->triggerErrorPinMode)); scheduleMsg(logger, "primary logic input: %s", hwPortname(boardConfiguration->logicAnalyzerPins[0])); scheduleMsg(logger, "secondary logic input: %s", hwPortname(boardConfiguration->logicAnalyzerPins[1])); #endif /* EFI_PROD_CODE */ }