Skip to content

Commit e54c7f0

Browse files
committed
RadioLib/RadioLib: Use new Tock HAL names
Signed-off-by: Alistair Francis <[email protected]>
1 parent 90a7091 commit e54c7f0

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
url = https://github.com/openthread/openthread.git
1010
[submodule "RadioLib/RadioLib"]
1111
path = RadioLib/RadioLib
12-
url = https://github.com/jgromes/RadioLib.git
12+
url = https://github.com/alistair23/RadioLib.git

examples/lora/sensor-lorawan/main.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(void) {
3535
printf("[SX1261] Initialising Radio ... \r\n");
3636

3737
// create a new instance of the HAL class
38-
TockHal* hal = new TockHal();
38+
TockRadioLibHal* hal = new TockRadioLibHal();
3939
int state;
4040

4141
// now we can create the radio module
@@ -44,7 +44,8 @@ int main(void) {
4444
// DIO1 pin: 2
4545
// NRST pin: 4
4646
// BUSY pin: 1
47-
SX1262 tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY);
47+
SX1262 tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET,
48+
RADIOLIB_RADIO_BUSY);
4849
LoRaWANNode node(&tock_module, Region, subBand);
4950

5051
// Setup the radio
@@ -69,8 +70,8 @@ int main(void) {
6970

7071
printf("success!\r\n");
7172

72-
hal->detachInterrupt(RADIO_DIO_1);
73-
hal->pinMode(RADIO_DIO_1, PIN_INPUT);
73+
hal->detachInterrupt(RADIOLIB_RADIO_DIO_1);
74+
hal->pinMode(RADIOLIB_RADIO_DIO_1, TOCK_RADIOLIB_PIN_INPUT);
7475

7576
int temp = 0;
7677
int humi = 0;

examples/lora/sensor-receive/main.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ int main(void) {
2121
printf("[SX1261] Initialising Radio ... \n");
2222

2323
// create a new instance of the HAL class
24-
TockHal* hal = new TockHal();
24+
TockRadioLibHal* hal = new TockRadioLibHal();
2525

2626
// now we can create the radio module
2727
// pinout corresponds to the SparkFun LoRa Thing Plus - expLoRaBLE
2828
// NSS pin: 0
2929
// DIO1 pin: 2
3030
// NRST pin: 4
3131
// BUSY pin: 1
32-
Module* tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY);
33-
SX1262* radio = new SX1262(tock_module);
32+
Module* tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET,
33+
RADIOLIB_RADIO_BUSY);
34+
SX1262* radio = new SX1262(tock_module);
3435

3536
// Setup the radio
3637
// The settings here work for the SparkFun LoRa Thing Plus - expLoRaBLE

examples/lora/sensor-transmit/main.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ int main(void) {
2525
printf("[SX1261] Initialising Radio ... \n");
2626

2727
// create a new instance of the HAL class
28-
TockHal* hal = new TockHal();
28+
TockRadioLibHal* hal = new TockRadioLibHal();
2929

3030
// now we can create the radio module
3131
// pinout corresponds to the SparkFun LoRa Thing Plus - expLoRaBLE
3232
// NSS pin: 0
3333
// DIO1 pin: 2
3434
// NRST pin: 4
3535
// BUSY pin: 1
36-
Module* tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY);
37-
SX1262* radio = new SX1262(tock_module);
36+
Module* tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET,
37+
RADIOLIB_RADIO_BUSY);
38+
SX1262* radio = new SX1262(tock_module);
3839

3940
// Setup the radio
4041
// The settings here work for the SparkFun LoRa Thing Plus - expLoRaBLE

0 commit comments

Comments
 (0)