Skip to content

Commit

Permalink
[SX126x] Fix image calibration (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Apr 4, 2024
1 parent 5d74177 commit a387b3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/SX126x/SX126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1841,8 +1841,13 @@ int16_t SX126x::setRfFrequency(uint32_t frf) {
return(this->mod->SPIwriteStream(RADIOLIB_SX126X_CMD_SET_RF_FREQUENCY, data, 4));
}

int16_t SX126x::calibrateImage(float freqMin, float freqMax) {
int16_t SX126x::calibrateImageRejection(float freqMin, float freqMax) {
// calculate the calibration coefficients and calibrate image
uint8_t data[] = { (uint8_t)floor((freqMin - 1.0f) / 4.0f), (uint8_t)ceil((freqMax + 1.0f) / 4.0f) };
return(this->calibrateImage(data));
}

int16_t SX126x::calibrateImage(uint8_t* data) {
int16_t state = this->mod->SPIwriteStream(RADIOLIB_SX126X_CMD_CALIBRATE_IMAGE, data, 2);

// if something failed, show the device errors
Expand Down

0 comments on commit a387b3b

Please sign in to comment.