auto-sync
This commit is contained in:
parent
a1afc46a13
commit
ebf6c75a50
|
@ -28,7 +28,10 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
|
||||||
|
|
||||||
engineConfiguration->injectionMode = IM_BATCH;
|
engineConfiguration->injectionMode = IM_BATCH;
|
||||||
|
// enable two_wire_batch_injection
|
||||||
engineConfiguration->twoWireBatchInjection = true;
|
engineConfiguration->twoWireBatchInjection = true;
|
||||||
|
// enable two_wire_wasted_spark
|
||||||
|
engineConfiguration->twoWireBatchIgnition = true;
|
||||||
|
|
||||||
// chartsize 600
|
// chartsize 600
|
||||||
engineConfiguration->engineChartSize = 600;
|
engineConfiguration->engineChartSize = 600;
|
||||||
|
|
|
@ -275,8 +275,9 @@ public:
|
||||||
/**
|
/**
|
||||||
* pre-calculated reference to which output pin should be used for
|
* pre-calculated reference to which output pin should be used for
|
||||||
* given sequence index within engine cycle
|
* given sequence index within engine cycle
|
||||||
|
* todo: update documentation
|
||||||
*/
|
*/
|
||||||
NamedOutputPin *ignitionPin[IGNITION_PIN_COUNT];
|
int ignitionPin[IGNITION_PIN_COUNT];
|
||||||
|
|
||||||
void onTriggerEvent(efitick_t nowNt);
|
void onTriggerEvent(efitick_t nowNt);
|
||||||
EngineState engineState;
|
EngineState engineState;
|
||||||
|
|
|
@ -90,16 +90,8 @@ void setSingleCoilDwell(engine_configuration_s *engineConfiguration) {
|
||||||
|
|
||||||
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
|
||||||
|
|
||||||
void initializeIgnitionActions(angle_t advance, angle_t dwellAngle,
|
|
||||||
IgnitionEventList *list DECLARE_ENGINE_PARAMETER_S) {
|
|
||||||
efiAssertVoid(engineConfiguration->specs.cylindersCount > 0, "cylindersCount");
|
|
||||||
|
|
||||||
list->reset();
|
|
||||||
|
|
||||||
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {
|
|
||||||
angle_t localAdvance = advance + ENGINE(angleExtra[i]);
|
|
||||||
NamedOutputPin *output = ENGINE(ignitionPin[i]);
|
|
||||||
|
|
||||||
|
static void addIgnitionEvent(angle_t localAdvance, angle_t dwellAngle, IgnitionEventList *list, NamedOutputPin *output DECLARE_ENGINE_PARAMETER_S) {
|
||||||
IgnitionEvent *event = list->add();
|
IgnitionEvent *event = list->add();
|
||||||
|
|
||||||
if (!isPinAssigned(output)) {
|
if (!isPinAssigned(output)) {
|
||||||
|
@ -111,6 +103,32 @@ void initializeIgnitionActions(angle_t advance, angle_t dwellAngle,
|
||||||
|
|
||||||
findTriggerPosition(&event->dwellPosition, localAdvance - dwellAngle PASS_ENGINE_PARAMETER);
|
findTriggerPosition(&event->dwellPosition, localAdvance - dwellAngle PASS_ENGINE_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initializeIgnitionActions(angle_t advance, angle_t dwellAngle,
|
||||||
|
IgnitionEventList *list DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
efiAssertVoid(engineConfiguration->specs.cylindersCount > 0, "cylindersCount");
|
||||||
|
|
||||||
|
list->reset();
|
||||||
|
|
||||||
|
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {
|
||||||
|
// todo: clean up this implementation? does not look too nice as is.
|
||||||
|
|
||||||
|
angle_t localAdvance = advance + ENGINE(angleExtra[i]);
|
||||||
|
int index = ENGINE(ignitionPin[i]);
|
||||||
|
int cylinderIndex = ID2INDEX(getCylinderId(CONFIG(specs.firingOrder), index));
|
||||||
|
NamedOutputPin *output = &enginePins.coils[cylinderIndex];
|
||||||
|
|
||||||
|
addIgnitionEvent(localAdvance, dwellAngle, list, output PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
|
if (CONFIG(ignitionMode) == IM_WASTED_SPARK && CONFIG(twoWireBatchIgnition)) {
|
||||||
|
index += CONFIG(specs.cylindersCount) / 2;
|
||||||
|
cylinderIndex = ID2INDEX(getCylinderId(CONFIG(specs.firingOrder), index));
|
||||||
|
output = &enginePins.coils[cylinderIndex];
|
||||||
|
|
||||||
|
addIgnitionEvent(localAdvance, dwellAngle, list, output PASS_ENGINE_PARAMETER);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FuelSchedule::registerInjectionEvent(int injectorIndex, float angle,
|
void FuelSchedule::registerInjectionEvent(int injectorIndex, float angle,
|
||||||
|
@ -344,25 +362,23 @@ int getCylinderId(firing_order_e firingOrder, int index) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NamedOutputPin * getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_S
|
static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_S
|
||||||
) {
|
) {
|
||||||
switch (CONFIG(ignitionMode)) {
|
switch (CONFIG(ignitionMode)) {
|
||||||
case IM_ONE_COIL:
|
case IM_ONE_COIL:
|
||||||
return &enginePins.coils[0];
|
return 0;
|
||||||
break;
|
break;
|
||||||
case IM_WASTED_SPARK: {
|
case IM_WASTED_SPARK: {
|
||||||
int wastedIndex = i % (CONFIG(specs.cylindersCount) / 2);
|
return i % (CONFIG(specs.cylindersCount) / 2);
|
||||||
int id = getCylinderId(CONFIG(specs.firingOrder), wastedIndex);
|
|
||||||
return &enginePins.coils[ID2INDEX(id)];
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IM_INDIVIDUAL_COILS:
|
case IM_INDIVIDUAL_COILS:
|
||||||
return &enginePins.coils[ID2INDEX(getCylinderId(CONFIG(specs.firingOrder), i))];
|
return i;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
warning(OBD_PCM_Processor_Fault, "unsupported ignitionMode %d in initializeIgnitionActions()", engineConfiguration->ignitionMode);
|
warning(OBD_PCM_Processor_Fault, "unsupported ignitionMode %d in initializeIgnitionActions()", engineConfiguration->ignitionMode);
|
||||||
return &enginePins.coils[0];
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +395,8 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {
|
for (int i = 0; i < CONFIG(specs.cylindersCount); i++) {
|
||||||
ENGINE(angleExtra[i])= ENGINE(engineCycle) * i / CONFIG(specs.cylindersCount);
|
ENGINE(angleExtra[i])= ENGINE(engineCycle) * i / CONFIG(specs.cylindersCount);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENGINE(ignitionPin[i]) = getIgnitionPinForIndex(i PASS_ENGINE_PARAMETER);
|
ENGINE(ignitionPin[i]) = getIgnitionPinForIndex(i PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,5 +275,5 @@ int getRusEfiVersion(void) {
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20160114;
|
return 20160116;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue