From e54c7f05e90f9560cbd8f887af6efd5dd7c7d87b Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Thu, 7 Nov 2024 12:44:54 +1000 Subject: [PATCH] RadioLib/RadioLib: Use new Tock HAL names Signed-off-by: Alistair Francis --- .gitmodules | 2 +- RadioLib/RadioLib | 2 +- examples/lora/sensor-lorawan/main.cc | 9 +++++---- examples/lora/sensor-receive/main.cc | 7 ++++--- examples/lora/sensor-transmit/main.cc | 7 ++++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.gitmodules b/.gitmodules index 748d052c7..18358dcee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ url = https://github.com/openthread/openthread.git [submodule "RadioLib/RadioLib"] path = RadioLib/RadioLib - url = https://github.com/jgromes/RadioLib.git + url = https://github.com/alistair23/RadioLib.git diff --git a/RadioLib/RadioLib b/RadioLib/RadioLib index 72ecc275a..075d977b7 160000 --- a/RadioLib/RadioLib +++ b/RadioLib/RadioLib @@ -1 +1 @@ -Subproject commit 72ecc275af5fe8303c58cb018783919e8809544b +Subproject commit 075d977b7129bad38f7cabb3e19e3ac48299dd99 diff --git a/examples/lora/sensor-lorawan/main.cc b/examples/lora/sensor-lorawan/main.cc index a0b7c0c2c..c1e19af47 100644 --- a/examples/lora/sensor-lorawan/main.cc +++ b/examples/lora/sensor-lorawan/main.cc @@ -35,7 +35,7 @@ int main(void) { printf("[SX1261] Initialising Radio ... \r\n"); // create a new instance of the HAL class - TockHal* hal = new TockHal(); + TockRadioLibHal* hal = new TockRadioLibHal(); int state; // now we can create the radio module @@ -44,7 +44,8 @@ int main(void) { // DIO1 pin: 2 // NRST pin: 4 // BUSY pin: 1 - SX1262 tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY); + SX1262 tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET, + RADIOLIB_RADIO_BUSY); LoRaWANNode node(&tock_module, Region, subBand); // Setup the radio @@ -69,8 +70,8 @@ int main(void) { printf("success!\r\n"); - hal->detachInterrupt(RADIO_DIO_1); - hal->pinMode(RADIO_DIO_1, PIN_INPUT); + hal->detachInterrupt(RADIOLIB_RADIO_DIO_1); + hal->pinMode(RADIOLIB_RADIO_DIO_1, TOCK_RADIOLIB_PIN_INPUT); int temp = 0; int humi = 0; diff --git a/examples/lora/sensor-receive/main.cc b/examples/lora/sensor-receive/main.cc index a64046104..96abfe14e 100644 --- a/examples/lora/sensor-receive/main.cc +++ b/examples/lora/sensor-receive/main.cc @@ -21,7 +21,7 @@ int main(void) { printf("[SX1261] Initialising Radio ... \n"); // create a new instance of the HAL class - TockHal* hal = new TockHal(); + TockRadioLibHal* hal = new TockRadioLibHal(); // now we can create the radio module // pinout corresponds to the SparkFun LoRa Thing Plus - expLoRaBLE @@ -29,8 +29,9 @@ int main(void) { // DIO1 pin: 2 // NRST pin: 4 // BUSY pin: 1 - Module* tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY); - SX1262* radio = new SX1262(tock_module); + Module* tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET, + RADIOLIB_RADIO_BUSY); + SX1262* radio = new SX1262(tock_module); // Setup the radio // The settings here work for the SparkFun LoRa Thing Plus - expLoRaBLE diff --git a/examples/lora/sensor-transmit/main.cc b/examples/lora/sensor-transmit/main.cc index a5312f242..93df04308 100644 --- a/examples/lora/sensor-transmit/main.cc +++ b/examples/lora/sensor-transmit/main.cc @@ -25,7 +25,7 @@ int main(void) { printf("[SX1261] Initialising Radio ... \n"); // create a new instance of the HAL class - TockHal* hal = new TockHal(); + TockRadioLibHal* hal = new TockRadioLibHal(); // now we can create the radio module // pinout corresponds to the SparkFun LoRa Thing Plus - expLoRaBLE @@ -33,8 +33,9 @@ int main(void) { // DIO1 pin: 2 // NRST pin: 4 // BUSY pin: 1 - Module* tock_module = new Module(hal, RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY); - SX1262* radio = new SX1262(tock_module); + Module* tock_module = new Module(hal, RADIOLIB_RADIO_NSS, RADIOLIB_RADIO_DIO_1, RADIOLIB_RADIO_RESET, + RADIOLIB_RADIO_BUSY); + SX1262* radio = new SX1262(tock_module); // Setup the radio // The settings here work for the SparkFun LoRa Thing Plus - expLoRaBLE