mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-26 22:33:24 +00:00
Add better error reporting for RF95 init failure
This commit is contained in:
parent
d3e64350d9
commit
d10b1e1d00
@ -14,8 +14,10 @@ int16_t RadioLibRF95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_
|
||||
{
|
||||
// execute common part
|
||||
int16_t state = SX127x::begin(RF95_CHIP_VERSION, syncWord, preambleLength);
|
||||
if (state != RADIOLIB_ERR_NONE)
|
||||
if (state != RADIOLIB_ERR_NONE) {
|
||||
LOG_WARN("Initial probe for RF95 failed with %d, trying again with alternative hardware version\n", state);
|
||||
state = SX127x::begin(RF95_ALT_VERSION, syncWord, preambleLength);
|
||||
}
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// current limit was removed from module' ctor
|
||||
@ -80,4 +82,4 @@ bool RadioLibRF95::isReceiving()
|
||||
uint8_t RadioLibRF95::readReg(uint8_t addr)
|
||||
{
|
||||
return mod->SPIreadRegister(addr);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user