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

enable proper multi instances of rc-switch + improved interrupt routine speed #346

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

Conversation

danyhm
Copy link
Contributor

@danyhm danyhm commented May 18, 2020

this PR enables multi instances of RC-switch where usage of more than 1 RC module in one sketch is possible (ie. 433 + 315)

fix #345

danyhm added 4 commits May 9, 2020 22:12
already compatible with stm32duino
move changeCount check to interrupt handler main routine in order to reduce overhead of calculations in the receiveProtocol() function.
enable multi instances of rc-switch support.
enable multi instances of rc-switch support.
volatile unsigned int RCSwitch::nReceivedBitlength = 0;
volatile unsigned int RCSwitch::nReceivedDelay = 0;
volatile unsigned int RCSwitch::nReceivedProtocol = 0;
int RCSwitch::nReceiveTolerance = 60;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find where nReceiveTolerance is set on the new version, do I miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
yes it's part of the class and in RCSwitch.h file

@@ -6,5 +6,5 @@ sentence=Operate 433/315Mhz devices.
paragraph=Use your Arduino, ESP8266/ESP32 or Raspberry Pi to operate remote radio controlled devices. This will most likely work with all popular low cost power outlet sockets.
category=Device Control
url=https://github.com/sui77/rc-switch
architectures=avr,esp8266,esp32
architectures=avr,esp8266,esp32,stm32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should not be here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's form the last commit. I don't know how to pull from your repo again.... not a git pro

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should not be here

I just found out this doesn't work for non ARM avrs because std::bind is not available.

@mrdsn3
Copy link

mrdsn3 commented Oct 26, 2021

so now can I use this from your library and proper multi instances/??

this update adds support for RP2040 cores and some minor fixes for stm32.
for now I have to remove AVR support because of the attachInterupt function callback problem not being supported.
notes for future development
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.

no more than 1 instance of rc-switch is usable
3 participants