Skip to content

Commit 2586d93

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

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
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

+4-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,7 @@ 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, RADIOLIB_RADIO_BUSY);
4848
LoRaWANNode node(&tock_module, Region, subBand);
4949

5050
// Setup the radio
@@ -69,8 +69,8 @@ int main(void) {
6969

7070
printf("success!\r\n");
7171

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

7575
int temp = 0;
7676
int humi = 0;

examples/lora/sensor-receive/main.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ 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);
32+
Module* tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET, RADIOLIB_RADIO_BUSY);
3333
SX1262* radio = new SX1262(tock_module);
3434

3535
// Setup the radio

examples/lora/sensor-transmit/main.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ 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);
36+
Module* tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET, RADIOLIB_RADIO_BUSY);
3737
SX1262* radio = new SX1262(tock_module);
3838

3939
// Setup the radio

0 commit comments

Comments
 (0)