let spark deal with spark limpManager
This commit is contained in:
parent
28d797d5c2
commit
9f4f85a097
|
@ -397,10 +397,6 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_
|
|||
return;
|
||||
}
|
||||
|
||||
LimpState limitedSparkState = engine->limpManager.allowIgnition();
|
||||
engine->outputChannels.sparkCutReason = (int8_t)limitedSparkState.reason;
|
||||
bool limitedSpark = !limitedSparkState.value;
|
||||
|
||||
LimpState limitedFuelState = engine->limpManager.allowInjection();
|
||||
engine->outputChannels.fuelCutReason = (int8_t)limitedFuelState.reason;
|
||||
bool limitedFuel = !limitedFuelState.value;
|
||||
|
@ -433,7 +429,7 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_
|
|||
/**
|
||||
* For spark we schedule both start of coil charge and actual spark based on trigger angle
|
||||
*/
|
||||
onTriggerEventSparkLogic(limitedSpark, trgEventIndex, rpm, edgeTimestamp);
|
||||
onTriggerEventSparkLogic(trgEventIndex, rpm, edgeTimestamp);
|
||||
}
|
||||
|
||||
// Check if the engine is not stopped or cylinder cleanup is activated
|
||||
|
|
|
@ -423,9 +423,7 @@ static void prepareIgnitionSchedule() {
|
|||
initializeIgnitionActions();
|
||||
}
|
||||
|
||||
void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp
|
||||
) {
|
||||
|
||||
void onTriggerEventSparkLogic(uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp) {
|
||||
ScopePerf perf(PE::OnTriggerEventSparkLogic);
|
||||
|
||||
if (!isValidRpm(rpm) || !engineConfiguration->isIgnitionEnabled) {
|
||||
|
@ -433,6 +431,10 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm
|
|||
return;
|
||||
}
|
||||
|
||||
LimpState limitedSparkState = engine->limpManager.allowIgnition();
|
||||
engine->outputChannels.sparkCutReason = (int8_t)limitedSparkState.reason;
|
||||
bool limitedSpark = !limitedSparkState.value;
|
||||
|
||||
if (!engine->ignitionEvents.isReady) {
|
||||
prepareIgnitionSchedule();
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp);
|
||||
void onTriggerEventSparkLogic(uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp);
|
||||
void turnSparkPinHigh(IgnitionEvent *event);
|
||||
void fireSparkAndPrepareNextSchedule(IgnitionEvent *event);
|
||||
int getNumberOfSparks(ignition_mode_e mode);
|
||||
|
|
Loading…
Reference in New Issue