xpertsavenue/WiringOP-Zero

Problem in interrupt function - wiringPiISR

Closed this issue · 7 comments

Hi, @xpertsavenue. I have been implementing the interruption example for a few days (for RFID readers - Wiegand). However, when we have the interrupt function call on the configured port it goes into "eternal loop" no longer leaves the function. I made a simpler example, a counter for the interrupt, and the problem persists. Where should I be wrong? It's an OrangePi Zero H2 +.
Thank you.

wiringPiISRCount.txt

Seeing that same issue here @xpertsavenue any idea?

No sorry, no idea. I just ported the library by renaming the pins some months ago- I definitely not good in understanding linux and c/c++

i have the same problem, i haven't found anybody with it working yet, have you guys fixed it?

Interrupt handling is definitely jacked up, seeing the same behavior here. The handler gets called repeatedly once triggered.

Just a quick find - in wiringPi/wiringPi.c, in the waitForInterrupt function, there should be an lseek done before the read.

Change:
(void)read (fd, &c, 1);

to:
lseek(fd, 0, SEEK_SET); (void) read(fd, &c, 1);

Hi. I tested interrupt via https://github.com/ngs/wiringPi/blob/master/examples/isr.c code

After changing
(void)read (fd, &c, 1) ;
to:
lseek(fd, 0, SEEK_SET); (void) read(fd, &c, 1) ; in wiringPi/wiringPi.c

as suggested by @Grimal , the "eternal loop" does not occur.

cheers :)

Great! I'm grateful for all your help!
@Grimal, @jstefanop, @Crying-Face-Emoji, @sunzone93 e @xpertsavenue