From 0bc0fc2c8124e14eef575dffffaa13a2c3e2ee5a Mon Sep 17 00:00:00 2001 From: ssp97 Date: Mon, 26 Jan 2026 02:09:50 +0800 Subject: [PATCH] fix: avoid redundant redefinition of SX126X_DIO3_TCXO_VOLTAGE --- src/helpers/radiolib/CustomLLCC68.h | 3 +-- src/helpers/radiolib/CustomSX1262.h | 3 +-- src/helpers/radiolib/CustomSX1268.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/helpers/radiolib/CustomLLCC68.h b/src/helpers/radiolib/CustomLLCC68.h index c239cc412..4269fc730 100644 --- a/src/helpers/radiolib/CustomLLCC68.h +++ b/src/helpers/radiolib/CustomLLCC68.h @@ -45,8 +45,7 @@ class CustomLLCC68 : public LLCC68 { int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f if (status == RADIOLIB_ERR_SPI_CMD_FAILED || status == RADIOLIB_ERR_SPI_CMD_INVALID) { - #define SX126X_DIO3_TCXO_VOLTAGE (0.0f); - tcxo = SX126X_DIO3_TCXO_VOLTAGE; + tcxo = 0.0f; status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); } if (status != RADIOLIB_ERR_NONE) { diff --git a/src/helpers/radiolib/CustomSX1262.h b/src/helpers/radiolib/CustomSX1262.h index bfaea7c76..3dca771b3 100644 --- a/src/helpers/radiolib/CustomSX1262.h +++ b/src/helpers/radiolib/CustomSX1262.h @@ -45,8 +45,7 @@ class CustomSX1262 : public SX1262 { int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f if (status == RADIOLIB_ERR_SPI_CMD_FAILED || status == RADIOLIB_ERR_SPI_CMD_INVALID) { - #define SX126X_DIO3_TCXO_VOLTAGE (0.0f); - tcxo = SX126X_DIO3_TCXO_VOLTAGE; + tcxo = 0.0f; status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); } if (status != RADIOLIB_ERR_NONE) { diff --git a/src/helpers/radiolib/CustomSX1268.h b/src/helpers/radiolib/CustomSX1268.h index 1e2e26204..f863829a0 100644 --- a/src/helpers/radiolib/CustomSX1268.h +++ b/src/helpers/radiolib/CustomSX1268.h @@ -45,8 +45,7 @@ class CustomSX1268 : public SX1268 { int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f if (status == RADIOLIB_ERR_SPI_CMD_FAILED || status == RADIOLIB_ERR_SPI_CMD_INVALID) { - #define SX126X_DIO3_TCXO_VOLTAGE (0.0f); - tcxo = SX126X_DIO3_TCXO_VOLTAGE; + tcxo = 0.0f; status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); } if (status != RADIOLIB_ERR_NONE) {