Merge pull request #417 from oltaco/promicro-CustomSX1262

refactor: promicro with CustomSX1262::std_init()
This commit is contained in:
ripplebiz 2025-06-20 13:47:40 +10:00 committed by GitHub
commit 5eb08474f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 41 deletions

View file

@ -30,6 +30,12 @@ class CustomSX1262 : public SX1262 {
#endif
#endif
int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8, 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;
status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8, tcxo);
}
if (status != RADIOLIB_ERR_NONE) {
Serial.print("ERROR: radio init failed: ");
Serial.println(status);