typo & better field name

This commit is contained in:
rusefi 2019-10-08 01:36:03 -04:00
parent 15ae9b1580
commit 74c8b59e44
3 changed files with 16 additions and 11 deletions

View File

@ -79,9 +79,10 @@ public:
LocalVersionHolder auxParametersVersion;
operation_mode_e getOperationMode(DECLARE_ENGINE_PARAMETER_SIGNATURE);
int globalSparkIdCoutner = 0;
/**
* 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;
#if !EFI_PROD_CODE
float mockMapValue = 0;
@ -118,9 +119,9 @@ public:
bool needToStopEngine(efitick_t nowNt) const;
bool etbAutoTune = false;
/**
* That's the list of pending spark firing events
* That's the linked list of pending spark firing events
*/
IgnitionEvent *iHead = nullptr;
IgnitionEvent *ignitionEventsHead = nullptr;
/**
* this is based on isEngineChartEnabled and engineSnifferRpmThreshold settings
*/

View File

@ -45,9 +45,13 @@ public:
uint32_t startOfDwell;
event_trigger_position_s dwellPosition;
event_trigger_position_s sparkPosition;
/**
* Ignition scheduler maintains a linked list of all pending ignition events.
*/
IgnitionEvent *next = nullptr;
/**
* @see globalSparkIdCoutner
* Sequential number of all spark events
* @see globalSparkIdCounter
*/
int sparkId = 0;
/**

View File

@ -235,7 +235,7 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI
return;
}
iEvent->sparkId = engine->globalSparkIdCoutner++;
iEvent->sparkId = engine->globalSparkIdCounter++;
/**
* We are alternating two event lists in order to avoid a potential issue around revolution boundary
@ -310,7 +310,7 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI
/**
* Spark should be scheduled in relation to some future trigger event, this way we get better firing precision
*/
bool isPending = assertNotInList<IgnitionEvent>(ENGINE(iHead), iEvent);
bool isPending = assertNotInList<IgnitionEvent>(ENGINE(ignitionEventsHead), iEvent);
if (isPending) {
#if SPARK_EXTREME_LOGGING
scheduleMsg(logger, "not adding to queue sparkDown ind=%d %d %s %d", trgEventIndex, getRevolutionCounter(), iEvent->getOutputForLoggins()->name, (int)getTimeNowUs());
@ -318,7 +318,7 @@ static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventI
return;
}
LL_APPEND(ENGINE(iHead), iEvent);
LL_APPEND(ENGINE(ignitionEventsHead), iEvent);
}
}
@ -379,11 +379,11 @@ static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNA
static void scheduleAllSparkEventsUntilNextTriggerTooth(uint32_t trgEventIndex DECLARE_ENGINE_PARAMETER_SUFFIX) {
IgnitionEvent *current, *tmp;
LL_FOREACH_SAFE(ENGINE(iHead), current, tmp)
LL_FOREACH_SAFE(ENGINE(ignitionEventsHead), current, tmp)
{
if (current->sparkPosition.triggerEventIndex == trgEventIndex) {
// time to fire a spark which was scheduled previously
LL_DELETE(ENGINE(iHead), current);
LL_DELETE(ENGINE(ignitionEventsHead), current);
scheduling_s * sDown = &current->signalTimerDown;