From b832d204e50307a1bbbe648b6873b75de58082bc Mon Sep 17 00:00:00 2001 From: mstroh76 Date: Sun, 24 Mar 2024 11:10:59 +0100 Subject: [PATCH] #204 fix message: ISR function alread active, ignoring --- wiringPi/wiringPi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index dc706ad..da1bef6 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -2257,6 +2257,7 @@ int waitForInterruptClose (int pin) { close(sysFds [pin]); } sysFds [pin] = -1; + isrFunctions [pin] = NULL; /* -not closing so far - other isr may be using it - only close if no other is using - will code later if (chipFd>0) { @@ -2298,7 +2299,9 @@ static void *interruptHandler (UNU void *arg) if (wiringPiDebug) { printf ("wiringPi: call function\n") ; } - isrFunctions [pin] () ; + if(isrFunctions [pin]) { + isrFunctions [pin] () ; + } // wait again - in the past forever - now can be stopped by waitForInterruptClose } else if( ret< 0) { break; // stop thread!