Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions variants/rpi_picow/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ build_flags = ${rp2040_base.build_flags}
-I variants/rpi_picow
; -D PICOW
; -D HW_SPI1_DEVICE

; Change between SPI and SPI1
; Default SPI1
-D PICOW_SPI=SPI1
; Alternative SPI aka SPI0 hardware on RP2040
; -D PICOW_SPI=SPI
; Set SPI and other pins correctly when changing SPI hardware

-D P_LORA_DIO_1=20
-D P_LORA_NSS=3
-D P_LORA_RESET=15
Expand Down
13 changes: 10 additions & 3 deletions variants/rpi_picow/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

PicoWBoard board;

RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI1);

#ifdef PICOW_SPI // if defined in config, use config value
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, PICOW_SPI);
#else // If not defines use default
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI1);
#endif
WRAPPER_CLASS radio_driver(radio, board);

VolatileRTCClock fallback_clock;
Expand All @@ -15,7 +18,11 @@ SensorManager sensors;
bool radio_init() {
rtc_clock.begin(Wire);

return radio.std_init(&SPI1);
#ifdef PICOW_SPI // If defined in config, use defined
return radio.std_init(&PICOW_SPI);
#else // If not defines, use default
return radio.std_init(&SPI1);
#endif
}

uint32_t radio_get_rng_seed() {
Expand Down