adafruit / RadioHead

A github'ified version of http://www.airspayce.com/mikem/arduino/RadioHead/
Other
189 stars 118 forks source link

Added error messages for RH_RF95 init #32

Closed scottbarnesg closed 5 years ago

scottbarnesg commented 5 years ago

Fixes Issue #31: Insufficient error messages on RH_RF95 init.

Adds error messages for each failure (return false) condition of the RH_RF95 init function. This will make debugging initialization issues significantly easier for users.

ladyada commented 5 years ago

Serial.println()'ing from a library is considered bad taste - you may want to, instead, have an #ifdef that people can turn on for more debugging - that's a much better ideas! also please use F("string") so AVRs dont use RAM for strings. thanks!

scottbarnesg commented 5 years ago

Updated per @ladyada's feedback:

Another option would be to update the RH_RF95 class with optional debug parameter that defaults to false, but I wasn't sure if this would cause compilation issues with environments that don't support Serial. Are there any target environments that don't support Serial? If not, I think this would be the better option.

ladyada commented 5 years ago

nice thank you :)