Skip to content

Commit e6cef8b

Browse files
tekka007tbowmo
authored andcommitted
Implement RFM95 sanity check (#963)
1 parent a00857a commit e6cef8b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/RFM95/RFM95.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,12 @@ LOCAL void RFM95_ATCmode(const bool OnOff, const int16_t targetRSSI)
584584

585585
LOCAL bool RFM95_sanityCheck(void)
586586
{
587-
// not implemented yet
588-
return true;
587+
bool result = true;
588+
result &= RFM95_readReg(RFM95_REG_0F_FIFO_RX_BASE_ADDR) == RFM95_RX_FIFO_ADDR;
589+
result &= RFM95_readReg(RFM95_REG_0E_FIFO_TX_BASE_ADDR) == RFM95_TX_FIFO_ADDR;
590+
result &= RFM95_readReg(RFM95_REG_23_MAX_PAYLOAD_LENGTH) == RFM95_MAX_PACKET_LEN;
591+
592+
return result;
589593
}
590594

591595

0 commit comments

Comments
 (0)