extra logging
This commit is contained in:
Andrey 2022-08-25 19:58:10 -04:00
parent e480e9d561
commit cecc5a9d6e
4 changed files with 11 additions and 7 deletions

View File

@ -260,10 +260,6 @@ public:
bool needTdcCallback = true; bool needTdcCallback = true;
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */
/**
* By the way 32-bit value should hold at least 400 hours of events at 6K RPM x 12 events per revolution
*/
int globalSparkIdCounter = 0;
// this is useful at least for real hardware integration testing - maybe a proper solution would be to simply // this is useful at least for real hardware integration testing - maybe a proper solution would be to simply
// GND input pins instead of leaving them floating // GND input pins instead of leaving them floating
@ -290,6 +286,7 @@ public:
scheduling_s tdcScheduler[2]; scheduling_s tdcScheduler[2];
#endif /* EFI_ENGINE_CONTROL */ #endif /* EFI_ENGINE_CONTROL */
// todo: move to electronic_throttle something?
bool etbAutoTune = false; bool etbAutoTune = false;
/** /**
* this is based on engineSnifferRpmThreshold settings and current RPM * this is based on engineSnifferRpmThreshold settings and current RPM
@ -320,6 +317,7 @@ public:
/** /**
* this is needed by getTimeIgnitionSeconds() and checkShutdown() * this is needed by getTimeIgnitionSeconds() and checkShutdown()
* todo: refactor to Timer?
*/ */
efitick_t ignitionOnTimeNt = 0; efitick_t ignitionOnTimeNt = 0;

View File

@ -119,7 +119,7 @@ public:
event_trigger_position_s dwellPosition{}; event_trigger_position_s dwellPosition{};
/** /**
* Sequential number of currently processed spark event * Sequential number of currently processed spark event
* @see globalSparkIdCounter * @see engineState.sparkCounter
*/ */
int sparkId = 0; int sparkId = 0;
/** /**

View File

@ -76,7 +76,10 @@ void endSimultaniousInjection(InjectionEvent *event) {
} }
void InjectorOutputPin::open(efitick_t nowNt) { void InjectorOutputPin::open(efitick_t nowNt) {
// per-output counter for error detection
overlappingCounter++; overlappingCounter++;
// global counter for logging
engine->engineState.fuelInjectionCounter++;
#if FUEL_MATH_EXTREME_LOGGING #if FUEL_MATH_EXTREME_LOGGING
if (printFuelDebug) { if (printFuelDebug) {

View File

@ -309,7 +309,10 @@ static void scheduleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, Igniti
return; return;
} }
event->sparkId = engine->globalSparkIdCounter++; /**
* By the way 32-bit value should hold at least 400 hours of events at 6K RPM x 12 events per revolution
*/
event->sparkId = engine->engineState.sparkCounter++;
efitick_t chargeTime = 0; efitick_t chargeTime = 0;
@ -452,7 +455,7 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm
// artificial misfire on cylinder #1 for testing purposes // artificial misfire on cylinder #1 for testing purposes
// enable artificialMisfire // enable artificialMisfire
// set_fsio_setting 6 20 // set_fsio_setting 6 20
warning(CUSTOM_ARTIFICIAL_MISFIRE, "artificial misfire on cylinder #1 for testing purposes %d", engine->globalSparkIdCounter); warning(CUSTOM_ARTIFICIAL_MISFIRE, "artificial misfire on cylinder #1 for testing purposes %d", engine->engineState.sparkCounter);
continue; continue;
} }
#if EFI_LAUNCH_CONTROL #if EFI_LAUNCH_CONTROL