Skip to content

Commit 1ce180d

Browse files
committed
remove spi.begin in targets
1 parent 0e19725 commit 1ce180d

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

variants/heltec_v2/target.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ bool radio_init() {
2525
rtc_clock.begin(Wire);
2626

2727
#if defined(P_LORA_SCLK)
28-
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
2928
return radio.std_init(&spi);
3029
#else
3130
return radio.std_init();

variants/lilygo_tbeam_SX1276/target.cpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,15 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
2727
DISPLAY_CLASS display;
2828
#endif
2929

30-
#ifndef LORA_CR
31-
#define LORA_CR 5
32-
#endif
33-
3430
bool radio_init() {
3531
fallback_clock.begin();
3632
rtc_clock.begin(Wire);
3733

3834
#if defined(P_LORA_SCLK)
39-
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
40-
#endif
41-
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8);
42-
if (status != RADIOLIB_ERR_NONE) {
43-
Serial.print("ERROR: radio init failed: ");
44-
Serial.println(status);
45-
return false; // fail
46-
}
47-
48-
#ifdef SX127X_CURRENT_LIMIT
49-
radio.setCurrentLimit(SX127X_CURRENT_LIMIT);
35+
return radio.std_init(&spi);
36+
#else
37+
return radio.std_init();
5038
#endif
51-
52-
radio.setCRC(1);
53-
54-
return true; // success
5539
}
5640

5741
uint32_t radio_get_rng_seed() {

variants/lilygo_tlora_v2_1/target.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ bool radio_init() {
2121
rtc_clock.begin(Wire);
2222

2323
#if defined(P_LORA_SCLK)
24-
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
2524
return radio.std_init(&spi);
2625
#else
2726
return radio.std_init();

0 commit comments

Comments
 (0)