extiTriggerTurnOnInputPin: respect efiExtiEnablePin() return value

This commit is contained in:
Andrey Gusakov 2024-03-05 23:43:20 +03:00 committed by rusefillc
parent 605b9c6db7
commit 83d6d9e7d8
1 changed files with 4 additions and 1 deletions

View File

@ -58,6 +58,10 @@ int extiTriggerTurnOnInputPin(const char *msg, int index, bool isTriggerShaft) {
efiPrintf("extiTriggerTurnOnInputPin %s %s", msg, hwPortname(brainPin));
if (efiExtiEnablePin(msg, brainPin, PAL_EVENT_MODE_BOTH_EDGES,
isTriggerShaft ? shaft_callback : cam_callback, (void *)index) < 0) {
return -1;
}
/* TODO:
* * do not set to both edges if we need only one
* * simplify callback in case of one edge */
@ -67,7 +71,6 @@ int extiTriggerTurnOnInputPin(const char *msg, int index, bool isTriggerShaft) {
} else {
camLines[index] = pal_line;
}
efiExtiEnablePin(msg, brainPin, PAL_EVENT_MODE_BOTH_EDGES, isTriggerShaft ? shaft_callback : cam_callback, (void *)index);
return 0;
}