}
/*
- * 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]);
return 0;
}
-/*
- * wiringPiISRStop:
- * stop thread interruptHandler
- *
- *********************************************************************************
- */
-
-int wiringPiISRStop (int pin) {
- return waitForInterruptClose (pin);
-}
-
/*
* interruptHandler:
extern const char *piMakerNames [16] ;
extern const int piMemorySize [ 8] ;
+
// Intended for the GPIO program Use at your own risk.
// Threads
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