Skip to content

Commit

Permalink
Fix LR1121 binding (ExpressLRS#2617)
Browse files Browse the repository at this point in the history
* fix LR1121 binding

* remove magic
  • Loading branch information
JyeSmith authored Apr 1, 2024
1 parent 05ebcfe commit 1dcf70b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 8 additions & 0 deletions src/src/tx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 1dcf70b

Please sign in to comment.