f4exb/picc1101

Race in radio.c

Opened this issue · 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?

f4exb commented

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.