From e96477e6ea4fc0b101534f878b3d58644c8e0109 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 3 Oct 2018 13:21:15 +0000 Subject: [PATCH] check value of radio.begin --- RF24Mesh.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RF24Mesh.cpp b/RF24Mesh.cpp index 7c9bb46..5707011 100755 --- a/RF24Mesh.cpp +++ b/RF24Mesh.cpp @@ -15,7 +15,8 @@ RF24Mesh::RF24Mesh( RF24& _radio,RF24Network& _network ): radio(_radio),network( bool RF24Mesh::begin(uint8_t channel, rf24_datarate_e data_rate, uint32_t timeout){ //delay(1); // Found problems w/SPIDEV & ncurses. Without this, getch() returns a stream of garbage - radio.begin(); + if(!radio.begin()) + return 0; radio_channel = channel; radio.setChannel(radio_channel); radio.setDataRate(data_rate);