From 116d60deb24714a74ad3e5de7012bac3e2c1157e Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 8 Dec 2024 10:14:26 +0100 Subject: [PATCH] [SX128x] Make Tx timeout at least 5 ms --- src/modules/SX128x/SX128x.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/SX128x/SX128x.cpp b/src/modules/SX128x/SX128x.cpp index 37b93619..3d1ce145 100644 --- a/src/modules/SX128x/SX128x.cpp +++ b/src/modules/SX128x/SX128x.cpp @@ -327,8 +327,8 @@ int16_t SX128x::transmit(const uint8_t* data, size_t len, uint8_t addr) { int16_t state = standby(); RADIOLIB_ASSERT(state); - // 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