icu trigger: do not crash on incorrect brainPin (#1082)

* icu trigger: do not crash on incorrect brainPin

* Update trigger_input_icu.cpp
This commit is contained in:
dron0gus 2020-01-03 17:13:55 +03:00 committed by rusefi
parent 4aba7756e2
commit eabde7079a
1 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,11 @@ void turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft) {
}
digital_input_s* input = startDigitalCapture("trigger", brainPin, true);
if (input == NULL) {
/* error already reported */
return;
}
if (isTriggerShaft) {
void * arg = (void*) (index == 0);
input->setWidthCallback((VoidInt)(void*)shaftWidthCallback, arg);