only:Lamborghini Diablo 1995 CKP Pattern #5876
This commit is contained in:
parent
100b7e9b6f
commit
1be5151e2b
|
@ -708,6 +708,9 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case trigger_type_e::TT_3_TOOTH_CRANK:
|
case trigger_type_e::TT_3_TOOTH_CRANK:
|
||||||
|
configure3ToothCrank(this);
|
||||||
|
break;
|
||||||
|
|
||||||
case trigger_type_e::TT_6_TOOTH_CRANK:
|
case trigger_type_e::TT_6_TOOTH_CRANK:
|
||||||
configure3ToothCrank(this);
|
configure3ToothCrank(this);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,7 +45,7 @@ static OutputPin emulatorOutputs[NUM_EMULATOR_CHANNELS][PWM_PHASE_MAX_WAVE_PER_P
|
||||||
|
|
||||||
void TriggerEmulatorHelper::handleEmulatorCallback(int channel, const MultiChannelStateSequence& multiChannelStateSequence, int stateIndex) {
|
void TriggerEmulatorHelper::handleEmulatorCallback(int channel, const MultiChannelStateSequence& multiChannelStateSequence, int stateIndex) {
|
||||||
efitick_t stamp = getTimeNowNt();
|
efitick_t stamp = getTimeNowNt();
|
||||||
|
|
||||||
// todo: code duplication with TriggerStimulatorHelper::feedSimulatedEvent?
|
// todo: code duplication with TriggerStimulatorHelper::feedSimulatedEvent?
|
||||||
#if EFI_SHAFT_POSITION_INPUT
|
#if EFI_SHAFT_POSITION_INPUT
|
||||||
for (size_t i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
|
for (size_t i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
|
||||||
|
@ -76,19 +76,25 @@ static int atTriggerVersions[NUM_EMULATOR_CHANNELS] = { 0 };
|
||||||
* todo: oh this method has only one usage? there must me another very similar method!
|
* todo: oh this method has only one usage? there must me another very similar method!
|
||||||
*/
|
*/
|
||||||
static float getRpmMultiplier(operation_mode_e mode) {
|
static float getRpmMultiplier(operation_mode_e mode) {
|
||||||
if (mode == FOUR_STROKE_THREE_TIMES_CRANK_SENSOR) {
|
switch (mode) {
|
||||||
return SYMMETRICAL_THREE_TIMES_CRANK_SENSOR_DIVIDER / 2;
|
case FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR:
|
||||||
} else if (mode == FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR) {
|
return SYMMETRICAL_CRANK_SENSOR_DIVIDER / 2;
|
||||||
return SYMMETRICAL_CRANK_SENSOR_DIVIDER / 2;
|
case FOUR_STROKE_THREE_TIMES_CRANK_SENSOR:
|
||||||
} else if (mode == FOUR_STROKE_TWELVE_TIMES_CRANK_SENSOR) {
|
return SYMMETRICAL_THREE_TIMES_CRANK_SENSOR_DIVIDER / 2;
|
||||||
return SYMMETRICAL_TWELVE_TIMES_CRANK_SENSOR_DIVIDER / 2;
|
case FOUR_STROKE_SIX_TIMES_CRANK_SENSOR:
|
||||||
} else if (mode == FOUR_STROKE_CAM_SENSOR) {
|
// todo: c'mon too much code duplication! at least reuse getCrankDivider when it works?!
|
||||||
return 0.5;
|
return SYMMETRICAL_SIX_TIMES_CRANK_SENSOR_DIVIDER / 2;
|
||||||
} else if (mode == FOUR_STROKE_CRANK_SENSOR) {
|
case FOUR_STROKE_TWELVE_TIMES_CRANK_SENSOR:
|
||||||
// unit test coverage still runs if the value below is changed to '2' not a great sign!
|
return SYMMETRICAL_TWELVE_TIMES_CRANK_SENSOR_DIVIDER / 2;
|
||||||
return 1;
|
case FOUR_STROKE_CAM_SENSOR:
|
||||||
}
|
return 0.5;
|
||||||
|
case OM_NONE:
|
||||||
|
case TWO_STROKE:
|
||||||
|
case FOUR_STROKE_CRANK_SENSOR:
|
||||||
|
// unit test coverage still runs if the value below is changed to '2' not a great sign!
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
|
criticalError("We should not have reach this line");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +178,7 @@ static void startSimulatedTriggerSignal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setTriggerEmulatorRPM(engineConfiguration->triggerSimulatorRpm);
|
setTriggerEmulatorRPM(engineConfiguration->triggerSimulatorRpm);
|
||||||
|
|
||||||
for (int channel = 0; channel < NUM_EMULATOR_CHANNELS; channel++) {
|
for (int channel = 0; channel < NUM_EMULATOR_CHANNELS; channel++) {
|
||||||
TriggerWaveform *s = triggerEmulatorWaveforms[channel];
|
TriggerWaveform *s = triggerEmulatorWaveforms[channel];
|
||||||
if (s->getSize() == 0)
|
if (s->getSize() == 0)
|
||||||
|
|
Loading…
Reference in New Issue