Skip to content

Commit 574822c

Browse files
committed
techo: follow refactoring of CustomSX1262
1 parent 587d9d8 commit 574822c

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

variants/techo/target.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,7 @@ TechoSensorManager sensors = TechoSensorManager(nmea);
2525
bool radio_init() {
2626
rtc_clock.begin(Wire);
2727

28-
#ifdef SX126X_DIO3_TCXO_VOLTAGE
29-
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
30-
#else
31-
float tcxo = 1.6f;
32-
#endif
33-
34-
SPI.setPins(P_LORA_MISO, P_LORA_SCLK, P_LORA_MOSI);
35-
SPI.begin();
36-
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8, tcxo);
37-
if (status != RADIOLIB_ERR_NONE) {
38-
Serial.print("ERROR: radio init failed: ");
39-
Serial.println(status);
40-
return false; // fail
41-
}
42-
43-
radio.setCRC(1);
44-
45-
#ifdef SX126X_CURRENT_LIMIT
46-
radio.setCurrentLimit(SX126X_CURRENT_LIMIT);
47-
#endif
48-
#ifdef SX126X_DIO2_AS_RF_SWITCH
49-
radio.setDio2AsRfSwitch(SX126X_DIO2_AS_RF_SWITCH);
50-
#endif
51-
#ifdef SX126X_RX_BOOSTED_GAIN
52-
radio.setRxBoostedGainMode(SX126X_RX_BOOSTED_GAIN);
53-
#endif
54-
55-
return true; // success
28+
return radio.std_init(&SPI);
5629
}
5730

5831
uint32_t radio_get_rng_seed() {

0 commit comments

Comments
 (0)