RFM69.initialize question

Started by Tomega3, December 11, 2014, 08:23:49 PM

Tomega3

I have been reading the RFM69.cpp file with great interest.
That is a powerful piece of code. My head is still swimming a little (maybe a lot)   :)

It looks like the initialize routine may wait for ever if its called and there is no radio connected or the radio is bad or some other failure to initialize.

Can it be modified to return a false if it waits to long in its 3 while loops?

Thanks

Felix

#1
Yes that is something I have to fix. Generally you would not use the lib without a radio, but I can see how this is a "bad" practice to let code loop forever and assume nothing bad can happen.
You might want to check Charly86's fix for that particular issue in his own fork of the lib: https://github.com/hallard/RFM69/blob/master/firmware/RFM69.cpp
I will try to integrate some of his improvements.

Tomega3

Thanks for the info, I see what Charly86's fix is.
I was thinking of something along those lines too.
I'll dig deeper and see if there are any other areas that may need a timeout in case the radio quits working or hangs after it has been initialized.

I think I saw that maybe the cansend tests may be a candidate. I have to keep looking.


diverdale

I downloaded Charley86's library and it works but I had to add a couple of items.

RFM69.h -- added #include <Arduino.h>

RFM69.cpp -- added #include "SPI.h"

those 2 mods and it works fine.

Hope it helps,
Dale