]> git.tnoah.ca Git - lora-radio.git/commitdiff
Enable fast preamble and change fast preamble length to 4ms
authorjacob.eva <x00010@disroot.org>
Wed, 16 Oct 2024 15:08:16 +0000 (16:08 +0100)
committerjacob.eva <x00010@disroot.org>
Wed, 16 Oct 2024 15:08:16 +0000 (16:08 +0100)
Radio.cpp
Radio.hpp

index 89e68d0175d28425dbea56abefca7189b8dac2b7..03b8e7019ce8aee3e0d527e293ca5e2fe91dca23 100644 (file)
--- 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 {
index 208a3d29db792716e253cd78927411f88bd85c74..905dc9a88af416baa09dda12a9147120b745f2c7 100644 (file)
--- 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