From 39780656ef58b9d928902c4dcc6c60e866b74a3e Mon Sep 17 00:00:00 2001 From: korbinianbauer <64415847+korbinianbauer@users.noreply.github.com> Date: Thu, 23 Oct 2025 16:15:12 +0200 Subject: [PATCH] Don't assign negative SNR to unsigned int type SNR-based contention windows are broken on systems with 64-bit long integers. Fixes #8430 --- src/mesh/RadioInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 31ec5acc5..3c0da4494 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -272,10 +272,10 @@ uint32_t RadioInterface::getTxDelayMsec() uint8_t RadioInterface::getCWsize(float snr) { // The minimum value for a LoRa SNR - const uint32_t SNR_MIN = -20; + const int32_t SNR_MIN = -20; // The maximum value for a LoRa SNR - const uint32_t SNR_MAX = 10; + const int32_t SNR_MAX = 10; return map(snr, SNR_MIN, SNR_MAX, CWmin, CWmax); }