refactor: promicro with CustomSX1262::std_init()

added check in CustomSX1262.h to support both txco and non-txco radios
switched promicro to use CustomSX1262::std_init()
此提交包含在:
taco
2025-06-20 11:22:34 +10:00
父節點 eb5826645e
當前提交 e7b0e9e526
共有 2 個檔案被更改,包括 7 行新增41 行删除
+6
查看文件
@@ -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);