From 577a0761ac0b5468c68ded009b77dc3460ed95dc Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 8 Dec 2024 10:15:22 +0100 Subject: [PATCH] [SX126x] Make Tx timeout at least 5 ms (#1338) --- src/modules/SX126x/SX126x.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index bddf8bec..7defbbcb 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -203,8 +203,8 @@ int16_t SX126x::transmit(const uint8_t* data, size_t len, uint8_t addr) { return(RADIOLIB_ERR_PACKET_TOO_LONG); } - // calculate timeout in ms (500% of expected time-on-air) - RadioLibTime_t timeout = (getTimeOnAir(len) * 5) / 1000; + // calculate timeout in ms (5ms + 500 % of expected time-on-air) + RadioLibTime_t timeout = 5 + (getTimeOnAir(len) * 5) / 1000; RADIOLIB_DEBUG_BASIC_PRINTLN("Timeout in %lu ms", timeout); // start transmission