Skip to content

Commit 67529d0

Browse files
author
Scott Powell
committed
Merge branch 'dev' into new-companion-ui
2 parents cc065c8 + 72d13ca commit 67529d0

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ out/
1010
.vscode/settings.json
1111
.vscode/extensions.json
1212
.idea
13-
cmake-*
13+
cmake-*
14+
.cache
15+
.ccls
16+
compile_commands.json

variants/waveshare_rp2040_lora/target.cpp

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,9 @@ VolatileRTCClock fallback_clock;
1212
AutoDiscoverRTCClock rtc_clock(fallback_clock);
1313
SensorManager sensors;
1414

15-
#ifndef LORA_CR
16-
#define LORA_CR 5
17-
#endif
18-
1915
bool radio_init() {
2016
rtc_clock.begin(Wire);
2117

22-
#ifdef SX126X_DIO3_TCXO_VOLTAGE
23-
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
24-
#else
25-
float tcxo = 1.6f;
26-
#endif
27-
2818
SPI1.setSCK(P_LORA_SCLK);
2919
SPI1.setTX(P_LORA_MOSI);
3020
SPI1.setRX(P_LORA_MISO);
@@ -34,30 +24,8 @@ bool radio_init() {
3424

3525
SPI1.begin(false);
3626

37-
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE,
38-
LORA_TX_POWER, 8, tcxo);
39-
40-
if (status != RADIOLIB_ERR_NONE) {
41-
Serial.print("ERROR: radio init failed: ");
42-
Serial.println(status);
43-
return false; // fail
44-
}
45-
46-
radio.setCRC(1);
47-
48-
#ifdef SX126X_CURRENT_LIMIT
49-
radio.setCurrentLimit(SX126X_CURRENT_LIMIT);
50-
#endif
51-
52-
#ifdef SX126X_DIO2_AS_RF_SWITCH
53-
radio.setDio2AsRfSwitch(SX126X_DIO2_AS_RF_SWITCH);
54-
#endif
55-
56-
#ifdef SX126X_RX_BOOSTED_GAIN
57-
radio.setRxBoostedGainMode(SX126X_RX_BOOSTED_GAIN);
58-
#endif
59-
60-
return true; // success
27+
//passing NULL skips init of SPI
28+
return radio.std_init(NULL);
6129
}
6230

6331
uint32_t radio_get_rng_seed() {

0 commit comments

Comments
 (0)