picc1101 icon indicating copy to clipboard operation
picc1101 copied to clipboard

Race in radio.c

Open kranzj opened this issue 8 years ago • 1 comments

Hey there,

the following line in radio.c seems to be problematic:

int_line = digitalRead(WPI_GDO0); // Sense interrupt line to determine if it was a raising or falling edge

I sometimes get two rising edge interrupts at once. Obviously this results in errors. I was able to solve the problem by waiting a millisecond before reading WPI_GDO0 which is obviously an evil hack. How could this be implemented reliably?

kranzj avatar Feb 11 '17 19:02 kranzj

Hello,

digitalRead() comes from the WiringPi library (http://wiringpi.com/reference/core-functions/) hence there is not much to be done in picc1101 to properly fix the problem. This problem should be reported to the author of WiringPi. I suppose it can be isolated in a simpler test program to show evidence. In the meantime the workaround you suggest seems to fix the problem.

Best regards.

f4exb avatar Feb 12 '17 08:02 f4exb