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:
@@ -894,6 +894,14 @@ int wiringPiISR (int pin, int mode, void (*function)(void))
|
|||||||
if (mode != INT_EDGE_SETUP) {
|
if (mode != INT_EDGE_SETUP) {
|
||||||
sprintf (pinS, "%d", GpioPin) ;
|
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;
|
FILE *export, *direct, *edge;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user