From 8d16e01ce5a6110956def527507b20b8ede45dc9 Mon Sep 17 00:00:00 2001 From: Egor Shitikov Date: Sun, 22 Sep 2024 12:00:28 -0700 Subject: [PATCH] status debug --- src/main.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a0276d7..1881d14 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -411,9 +411,9 @@ void init_radio() both.println("Init radio"); #ifdef USING_SX1280PA radio.begin(); - state == radio.beginGFSK(FREQ_BEGIN); + state = radio.beginGFSK(FREQ_BEGIN); #else - state == radio.beginFSK(FREQ_BEGIN); + state = radio.beginFSK(FREQ_BEGIN); #endif if (state == RADIOLIB_ERR_NONE) { @@ -450,14 +450,26 @@ void init_radio() #endif // and disable the data shaping - RADIOLIB_OR_HALT(radio.setDataShaping(RADIOLIB_SHAPING_NONE)); + state = radio.setDataShaping(RADIOLIB_SHAPING_NONE); + if (state != RADIOLIB_ERR_NONE) + { + Serial.println("Error:setDataShaping:" + String(state)); + } both.println("Starting scanning..."); // calibrate only once ,,, at startup // TODO: check documentation (9.2.1) if we must calibrate in certain ranges #ifdef USING_SX1280PA - radio.setFrequency(FREQ_BEGIN); + state = radio.setFrequency(FREQ_BEGIN); + if (state != RADIOLIB_ERR_NONE) + { + Serial.println("Error:setFrequency:" + String(state)); + } state = radio.startReceive(); + if (state != RADIOLIB_ERR_NONE) + { + Serial.println("Error:startReceive:" + String(state)); + } #else radio.setFrequency(FREQ_BEGIN, true); #endif