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

Use ring buffer and semaphore #87

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Locke
Copy link

@Locke Locke commented Oct 2, 2016

This PR is based on UrbaneChimp/433Utils@3f2517e, I only did the porting.

I basically have the issue mentioned in ninjablocks/433Utils#16. @rotv pointed out that there is a fork with a solution which could be applied here (as ninjablocks/433Utils#17 is merged by now). Actually there are a few more forks containing that solution and it appears none has brought it up here.

I tested these changes with a small change to the 433Utils on a raspberry pi: https://github.com/Locke/433Utils/blob/popEvent/RPi_utils/RFSniffer.cpp

My biggest concern is that this pulls in another dependency which might not be available / suited for the Arduino. I can imagine using flags to enable these changes only for the RPI or via a new flag.

@Locke
Copy link
Author

Locke commented Oct 2, 2016

My biggest concern is that this pulls in another dependency which might not be available / suited for the Arduino. I can imagine using flags to enable these changes only for the RPI or via a new flag.

My feeling was right. I read a bit about Arduino and multitasking and understand now that this approach doesn't make sense for the Arduino. (Even if you use something like ArduinoThread to schedule tasks you would check .available() and not "block a thread".)

I'm not sure what the best approach is to control this via flags. Add a RCSwitchEnableBlockingReceive flag and enable it by default for the RPI? Any other suggestions?

@Locke
Copy link
Author

Locke commented Oct 2, 2016

I added the RCSwitchEnableBlockingReceive flag. It will be defined when RPI is defined, unless RCSwitchDisableReceiving is set.

@Locke Locke mentioned this pull request Apr 10, 2020
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

Successfully merging this pull request may close these issues.

1 participant