Skip to content

Use ring buffer and semaphore#87

Open
Locke wants to merge 2 commits intosui77:masterfrom
Locke:UrbaneChimp-3f2517e
Open

Use ring buffer and semaphore#87
Locke wants to merge 2 commits intosui77:masterfrom
Locke:UrbaneChimp-3f2517e

Conversation

@Locke
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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