mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #417 from oltaco/promicro-CustomSX1262
refactor: promicro with CustomSX1262::std_init()
This commit is contained in:
commit
5eb08474f1
2 changed files with 7 additions and 41 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue