LowPowerLab / RFM69

RFM69 library for RFM69W, RFM69HW, RFM69CW, RFM69HCW (semtech SX1231, SX1231H)
GNU General Public License v3.0
777 stars 381 forks source link

Multiple Radios per node #73

Open wizard97 opened 7 years ago

wizard97 commented 7 years ago

I think a relatively simple, and nice addition would be the ability for this library to handle multiple instances with multiple radios.

I think the changes would be relatively simple, currently there is just a public static RFM69 self pointer, that gets called by the ISR. All you would have to do is create a simple linked list of RFM69 objects, add an additional attribute to the class that is a RFM69 next pointer. Whenever the ISR fires, in the isr routine just traverse through the list and digitalRead each RFM69's isr pin to figure out which device triggered the interrupt, then call the associated handler.

LowPowerLab commented 7 years ago

Thanks for your thoughts, this was discussed before. In most cases there is 1 radio per module and I don't personally have a need for more. You're welcome to submit a PR if you'd like but any changes require extensive testing.