Skip to content

Commit 9d1d9c8

Browse files
author
Wessel Nieboer
committed
calibrate for configured frequency band
1 parent 9ff1a5a commit 9d1d9c8

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/mesh/LR11x0Interface.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,14 @@ template <typename T> void LR11x0Interface<T>::resetAGC()
318318
uint8_t calData = RADIOLIB_LR11X0_CALIBRATE_ALL;
319319
module.SPIwriteStream(RADIOLIB_LR11X0_CMD_CALIBRATE, &calData, 1, true, true);
320320

321-
// 4. Re-apply RX boosted gain mode
321+
// 4. Re-calibrate image rejection for actual operating frequency
322+
// Calibrate(0x3F) defaults to 902-928 MHz which is wrong for other regions.
323+
lora.calibrateImageRejection(getFreq() - 4.0f, getFreq() + 4.0f);
324+
325+
// 5. Re-apply RX boosted gain mode
322326
lora.setRxBoostedGainMode(config.lora.sx126x_rx_boosted_gain);
323327

324-
// 5. Resume receiving
328+
// 6. Resume receiving
325329
startReceive();
326330
}
327331

src/mesh/SX126xInterface.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,11 @@ template <typename T> void SX126xInterface<T>::resetAGC()
468468
return;
469469
}
470470

471-
// 5. Re-apply settings that calibration may have reset
471+
// 5. Re-calibrate image rejection for actual operating frequency
472+
// Calibrate(0x7F) defaults to 902-928 MHz which is wrong for other regions.
473+
lora.calibrateImage(getFreq());
474+
475+
// Re-apply settings that calibration may have reset
472476

473477
// DIO2 as RF switch
474478
#ifdef SX126X_DIO2_AS_RF_SWITCH

0 commit comments

Comments
 (0)