From 1dcf70bbaced48cd2be98e50d5cef66f41c54e23 Mon Sep 17 00:00:00 2001 From: Jye <14170229+JyeSmith@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:13:28 +1000 Subject: [PATCH] Fix LR1121 binding (#2617) * fix LR1121 binding * remove magic --- src/include/common.h | 1 + src/src/tx_main.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/include/common.h b/src/include/common.h index 43b2f633c0..66084389b0 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -247,6 +247,7 @@ extern SX127xDriver Radio; #elif defined(RADIO_LR1121) #define RATE_MAX 14 #define RATE_BINDING RATE_LORA_50HZ +#define RATE_DUALBAND_BINDING 9 // 2.4GHz 50Hz extern LR1121Driver Radio; diff --git a/src/src/tx_main.cpp b/src/src/tx_main.cpp index 6e435775f1..701e093041 100644 --- a/src/src/tx_main.cpp +++ b/src/src/tx_main.cpp @@ -976,6 +976,14 @@ static void EnterBindingMode() // Start attempting to bind // Lock the RF rate and freq while binding SetRFLinkRate(enumRatetoIndex(RATE_BINDING)); + +#if defined(RADIO_LR1121) + FHSSuseDualBand = true; + expresslrs_mod_settings_s *const dualBandBindingModParams = get_elrs_airRateConfig(RATE_DUALBAND_BINDING); // 2.4GHz 50Hz + Radio.Config(dualBandBindingModParams->bw2, dualBandBindingModParams->sf2, dualBandBindingModParams->cr2, FHSSgetInitialGeminiFreq(), + dualBandBindingModParams->PreambleLen2, true, dualBandBindingModParams->PayloadLength, dualBandBindingModParams->interval, SX12XX_Radio_2); +#endif + Radio.SetFrequencyReg(FHSSgetInitialFreq()); if (isDualRadio() && config.GetAntennaMode() == TX_RADIO_MODE_GEMINI) // Gemini mode {