This commit is contained in:
Matthew Kennedy 2022-10-27 20:17:02 -07:00 committed by GitHub
parent 5fb963fcc8
commit 0ee7be20d8
1 changed files with 6 additions and 5 deletions

View File

@ -190,13 +190,14 @@ void applyNewTriggerInputPins() {
#if EFI_PROD_CODE
// first we will turn off all the changed pins
stopTriggerInputPins();
if (isConfigurationChanged(triggerInputDebugPins[0])) {
if (isBrainPinValid(engineConfiguration->triggerInputPins[0])) {
engine->rpmCalculator.Register();
} else {
// if we do not have primary input channel maybe it's BCM mode and we inject RPM value via Lua?
engine->rpmCalculator.unregister();
if (isBrainPinValid(engineConfiguration->triggerInputDebugPins[0])) {
// if we do not have primary input channel maybe it's BCM mode and we inject RPM value via Lua?
engine->rpmCalculator.Register();
}
}
// then we will enable all the changed pins
startTriggerInputPins();
#endif /* EFI_PROD_CODE */