Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race in radio.c #3

Open
kranzj opened this issue Feb 11, 2017 · 1 comment
Open

Race in radio.c #3

kranzj opened this issue Feb 11, 2017 · 1 comment

Comments

@kranzj
Copy link

kranzj commented Feb 11, 2017

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
Copy link
Owner

f4exb commented Feb 12, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants