diff --git a/Radio.cpp b/Radio.cpp index 89e68d0..03b8e70 100644 --- a/Radio.cpp +++ b/Radio.cpp @@ -2644,11 +2644,11 @@ void sx128x::updateBitrate() { if (_csma_slot_ms < CSMA_SLOT_MIN_MS) { _csma_slot_ms = CSMA_SLOT_MIN_MS; } float target_preamble_symbols; - //if (_bitrate <= LORA_FAST_BITRATE_THRESHOLD) { + if (_bitrate <= LORA_FAST_BITRATE_THRESHOLD) { target_preamble_symbols = (LORA_PREAMBLE_TARGET_MS/_lora_symbol_time_ms)-LORA_PREAMBLE_SYMBOLS_HW; - //} else { - /*target_preamble_symbols = (LORA_PREAMBLE_FAST_TARGET_MS/_lora_symbol_time_ms)-LORA_PREAMBLE_SYMBOLS_HW; - }*/ + } else { + target_preamble_symbols = (LORA_PREAMBLE_FAST_TARGET_MS/_lora_symbol_time_ms)-LORA_PREAMBLE_SYMBOLS_HW; + } if (target_preamble_symbols < LORA_PREAMBLE_SYMBOLS_MIN) { target_preamble_symbols = LORA_PREAMBLE_SYMBOLS_MIN; } else { diff --git a/Radio.hpp b/Radio.hpp index 208a3d2..905dc9a 100644 --- a/Radio.hpp +++ b/Radio.hpp @@ -34,7 +34,7 @@ #define LORA_PREAMBLE_SYMBOLS_HW 4 #define LORA_PREAMBLE_SYMBOLS_MIN 18 #define LORA_PREAMBLE_TARGET_MS 15 -#define LORA_PREAMBLE_FAST_TARGET_MS 1 +#define LORA_PREAMBLE_FAST_TARGET_MS 4 #define LORA_FAST_BITRATE_THRESHOLD 40000 #define CSMA_SLOT_MAX_MS 100 #define CSMA_SLOT_MIN_MS 24