]> git.feebdaed.xyz Git - 0xmirror/WiringPi.git/commitdiff
wiringPi.c ; waitForInterrupt releases fd and line itself, wiringPiISRStop not necess...
authorphylax2020 <severin.hoffmann@t-online.de>
Mon, 17 Feb 2025 21:09:07 +0000 (22:09 +0100)
committerphylax2020 <severin.hoffmann@t-online.de>
Mon, 17 Feb 2025 21:09:07 +0000 (22:09 +0100)
wiringPi/wiringPi.c
wiringPi/wiringPi.h

index 2b3781256dac8681e6a1140026ade263ac1e29d2..f1ac321bdd9620af5c458df8fecf98e179a382e7 100644 (file)
@@ -2782,34 +2782,35 @@ long long int waitForInterrupt (int pin, int edgeMode, int mS, unsigned long deb
 }
 
 /*
- * waitForInterruptClose:
- *     wait for thread interruptHandler to be stopped.
+ * wiringPiISRStop:
+ * stop interruptHandler thread and
+ * wait untill stopped.
  * close isrFds[pin], reset isrFds[pin], isrFunction[pin] and isrDebouncePeriodUs[pin]
  *
  *********************************************************************************
  */
 
-int waitForInterruptClose (int pin) {
+int wiringPiISRStop (int pin) {
   void *res; 
   
   if (isrFds[pin] > 0) {
     if (wiringPiDebug)
-      printf ("waitForInterruptClose: close thread 0x%lX\n", (unsigned long)isrThreads[pin]) ;
+      printf ("wiringPiISRStop: close thread 0x%lX\n", (unsigned long)isrThreads[pin]) ;
     
     if (isrThreads[pin] != 0) {
       if (pthread_cancel(isrThreads[pin]) == 0) {
         pthread_join(isrThreads[pin], &res); 
         if (res == PTHREAD_CANCELED) {
             if (wiringPiDebug)
-               printf("waitForInterruptClose: thread was canceled\n");
+               printf("wiringPiISRStop: thread was canceled\n");
         }
         else {
             if (wiringPiDebug)
-               printf("waitForInterruptClose: thread was not canceled\n");
+               printf("wiringPiISRStop: thread was not canceled\n");
         }
       } else {
         if (wiringPiDebug)
-          printf ("waitForInterruptClose: waitForInterruptClose could not cancel thread\n");
+          printf ("wiringPiISRStop: could not cancel thread\n");
       }
     }
     close(isrFds [pin]);
@@ -2830,17 +2831,6 @@ int waitForInterruptClose (int pin) {
   return 0;
 }
 
-/*
- * wiringPiISRStop:
- *     stop thread interruptHandler 
- *
- *********************************************************************************
- */
-
-int wiringPiISRStop (int pin) {
-  return waitForInterruptClose (pin);
-}
-
 
 /*
  * interruptHandler:
index 964fed37644db96ec913bdeaeca9a92875c83a59..e299f992471f65bb45c5f7d8548bef20ccb9d75d 100644 (file)
@@ -144,6 +144,7 @@ extern const char *piRevisionNames [16] ;
 extern const char *piMakerNames    [16] ;
 extern const int   piMemorySize    [ 8] ;
 
+
 //     Intended for the GPIO program Use at your own risk.
 
 // Threads
@@ -301,7 +302,6 @@ extern          void digitalWriteByte2   (int value) ;
 extern long long int  waitForInterrupt    (int pin, int edgeMode, int mS, unsigned long debounce_period_us) ;   // V3.14 phylax
 extern int  wiringPiISR         (int pin, int mode, void (*function)(unsigned int, long long int), unsigned long debounce_period_us) ;  // v3.14 phylax
 extern int  wiringPiISRStop     (int pin) ;  //V3.2
-extern int  waitForInterruptClose(int pin) ; //V3.2
 
 // Threads