Rewrote library to allow for multiple RX pins #2
WARNING: This breaks the current API (although a fix is simple enough).
Rewrote example (
Previously, if multiple pins were enabled at once (with
There is the additional issue that the version of RCSwitch that Particle uses (repo here) is very out-of-date, which causes a few extra problems. The implementation of many functions is different from those in the official version, there is missing support for many protocols, and the API is slightly different. For the official RCSwitch library, there have been attempts in the past to implement multiple-pin RX (see here and here), but none have been successful. I have opened an issue detailing the changes needed to get multiple-pin RX actually working, but due to how behind the Particle library is, patching it into the official library is non-trivial (will either require porting or updating Particle's library to match the current official repo).
To address this issue, the simplest solution is to separate the global/static data used in the interrupt handler into different sets per RX pin (create an array), and size it based off a
I refactored all the data used in the interrupt handler into a struct (
I also added an additional member,