SPARK_EXTREME_LOGGING

This commit is contained in:
Andrey 2021-10-01 23:50:32 -04:00
parent 7398ba5059
commit 2a2722c3cc
2 changed files with 31 additions and 0 deletions

View File

@ -126,10 +126,16 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
}
static void chargeTrailingSpark(IgnitionOutputPin* pin) {
#if SPARK_EXTREME_LOGGING
efiPrintf("chargeTrailingSpark %s", pin->name);
#endif /* SPARK_EXTREME_LOGGING */
pin->setHigh();
}
static void fireTrailingSpark(IgnitionOutputPin* pin) {
#if SPARK_EXTREME_LOGGING
efiPrintf("fireTrailingSpark %s", pin->name);
#endif /* SPARK_EXTREME_LOGGING */
pin->setLow();
}
@ -202,6 +208,10 @@ if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
engine->executor.scheduleByTimestampNt("firing", &event->sparkEvent.scheduling, nextFiring, { fireSparkAndPrepareNextSchedule, event });
} else {
if (CONFIG(enableTrailingSparks)) {
#if SPARK_EXTREME_LOGGING
efiPrintf("scheduleByAngle TrailingSparks");
#endif /* SPARK_EXTREME_LOGGING */
// Trailing sparks are enabled - schedule an event for the corresponding trailing coil
scheduleByAngle(
&event->trailingSparkFire, nowNt, ENGINE(engineState.trailingSparkAngle),

View File

@ -305,7 +305,16 @@ const char *NamedOutputPin::getShortName() const {
return shortName == nullptr ? name : shortName;
}
#if EFI_UNIT_TEST
extern bool verboseMode;
#endif // EFI_UNIT_TEST
void NamedOutputPin::setHigh() {
#if EFI_UNIT_TEST
if (verboseMode) {
efiPrintf("pin %s goes high", name);
}
#endif // EFI_UNIT_TEST
#if EFI_DEFAILED_LOGGING
// signal->hi_time = hTimeNow();
#endif /* EFI_DEFAILED_LOGGING */
@ -319,6 +328,12 @@ void NamedOutputPin::setHigh() {
}
void NamedOutputPin::setLow() {
#if EFI_UNIT_TEST
if (verboseMode) {
efiPrintf("pin %s goes low", name);
}
#endif // EFI_UNIT_TEST
// turn off the output
setValue(false);
@ -402,6 +417,12 @@ void OutputPin::setValue(int logicValue) {
// ScopePerf perf(PE::OutputPinSetValue);
#endif // ENABLE_PERF_TRACE
#if EFI_UNIT_TEST
if (verboseMode) {
efiPrintf("pin goes %d", logicValue);
}
#endif // EFI_UNIT_TEST
// Always store the current logical value of the pin (so it can be
// used internally even if not connected to a real hardware pin)
currentLogicValue = logicValue;