Usability: critical error in case of unneeded second channel fix #6419

This commit is contained in:
rusefi 2024-04-26 18:49:24 -04:00 committed by rusefillc
parent 6c193efb60
commit 4744515cf5
3 changed files with 13 additions and 1 deletions

View File

@ -30,6 +30,7 @@ Release template (copy/paste this for new release):
- "60/2 VW" trigger wheel renamed to "60-2 Wrong Polarity" #988
- exhaust VVTs now use it's onw Edge Select setting
- removing weird 1+16 trigger wheel #6418
- critical error in case of unneeded second channel #6419
## Unreleased

View File

@ -111,7 +111,7 @@ void setBoardDefaultConfiguration() {
engineConfiguration->triggerSimulatorPins[1] = Gpio::D2;
engineConfiguration->triggerInputPins[0] = Gpio::C6;
engineConfiguration->triggerInputPins[1] = Gpio::A5;
// engineConfiguration->triggerInputPins[1] = Gpio::A5;
// set this to SPI_DEVICE_3 to enable stimulation
//engineConfiguration->digitalPotentiometerSpiDevice = SPI_DEVICE_3;

View File

@ -771,6 +771,17 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
warning(ObdCode::CUSTOM_ERR_NO_SHAPE, "initializeTriggerWaveform() not implemented: %d", triggerType.type);
}
if (!needSecondTriggerInput &&
#if EFI_UNIT_TEST
engineConfiguration != nullptr &&
#endif
engineConfiguration->triggerInputPins[1] != Gpio::Unassigned) {
// todo: technical debt: HW CI should not require special treatment
#ifndef HARDWARE_CI
criticalError("Single-channel trigger %s selected while two inputs were configured", getTrigger_type_e(triggerType.type));
#endif
}
/**
* Feb 2019 suggestion: it would be an improvement to remove 'expectedEventCount' logic from 'addEvent'
* and move it here, after all events were added.