From d39dea903ff057238bf2acca430350e035e1f785 Mon Sep 17 00:00:00 2001
From: Davide Mor <tazdevil971@gmail.com>
Date: Sun, 6 Aug 2023 22:33:02 +0200
Subject: [PATCH] [sx1278] Reworded comment

---
 src/shared/radio/SX1278/SX1278Fsk.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/shared/radio/SX1278/SX1278Fsk.cpp b/src/shared/radio/SX1278/SX1278Fsk.cpp
index 455b99327..ddd866875 100644
--- a/src/shared/radio/SX1278/SX1278Fsk.cpp
+++ b/src/shared/radio/SX1278/SX1278Fsk.cpp
@@ -99,7 +99,11 @@ SX1278Fsk::Error SX1278Fsk::configure(const Config &config)
     LockMode guard_mode(*this, guard, RegOpMode::MODE_STDBY, DEFAULT_MAPPING,
                         InterruptTrigger::RISING_EDGE);
 
-    // The datasheet lies, this IRQ is unreliable, it doesn't always trigger
+    // This code is unreliable so it got commented out, the datasheet states
+    // that this triggers during a successful state transition, but for some
+    // reason, this isn't always the case, and can lead to random failures of
+    // the driver initialization. Removing it has no side effects, so that is
+    // what was done.
     // if (!waitForIrqBusy(guard_mode, RegIrqFlags::MODE_READY, 0, 1000))
     //     return Error::IRQ_TIMEOUT;
 
@@ -312,7 +316,8 @@ ssize_t SX1278Fsk::receive(uint8_t *pkt, size_t max_len)
         // For some reason this sometimes happen?
     } while (len == 0);
 
-    if (len > max_len || (!crc_ok && crc_enabled)) {
+    if (len > max_len || (!crc_ok && crc_enabled))
+    {
         return -1;
     }
 
-- 
GitLab