ODROID-XU3/4: Fix wiringPiISR.

If a pin is exported, ISR does not work on XU4.
We will clear pin before using with wiringPiISR function.

Signed-off-by: Steve Jeong <how2soft@gmail.com>
Change-Id: Ibc747fe30fda20253eb77d9bbe5f6bcc8c2180b8
This commit is contained in:
Chris
2023-02-10 16:56:38 +09:00
committed by Steve Jeong
parent fd979a42cf
commit 7fd008992e

View File

@@ -894,6 +894,14 @@ int wiringPiISR (int pin, int mode, void (*function)(void))
if (mode != INT_EDGE_SETUP) {
sprintf (pinS, "%d", GpioPin) ;
char temp[64];
sprintf(temp, "/sys/class/gpio/gpio%d", GpioPin);
if (access(temp, F_OK) == 0) {
FILE *unexport = fopen("/sys/class/gpio/unexport", "w");
fprintf (unexport, "%d\n", GpioPin);
fclose(unexport);
}
FILE *export, *direct, *edge;
int count;