From 39718693e65d43cd678cf380fc27d2624f667218 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 13 Feb 2024 20:13:07 +0000 Subject: [PATCH] Fix RAK4630 compilation error and SX1280 modemStatus logic --- Boards.h | 1 + sx128x.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Boards.h b/Boards.h index 4f079f3..3385431 100644 --- a/Boards.h +++ b/Boards.h @@ -14,6 +14,7 @@ // along with this program. If not, see . #include "Modem.h" +#include #ifndef BOARDS_H #define BOARDS_H diff --git a/sx128x.cpp b/sx128x.cpp index 759b73a..065598d 100644 --- a/sx128x.cpp +++ b/sx128x.cpp @@ -467,13 +467,13 @@ uint8_t sx128x::modemStatus() { uint8_t byte = 0x00; - if (buf[0] & IRQ_PREAMBLE_DET_MASK_8X != 0) { + if ((buf[0] & IRQ_PREAMBLE_DET_MASK_8X) != 0) { byte = byte | 0x01 | 0x04; // clear register after reading clearbuf[0] = 0xFF; } - if (buf[1] & IRQ_HEADER_DET_MASK_8X != 0) { + if ((buf[1] & IRQ_HEADER_DET_MASK_8X) != 0) { byte = byte | 0x02 | 0x04; // clear register after reading clearbuf[1] = 0xFF;