diff --git a/examples/NonArduino/ESP-IDF/main/main.cpp b/examples/NonArduino/ESP-IDF/main/main.cpp index 9a2272b6..45e6f75d 100644 --- a/examples/NonArduino/ESP-IDF/main/main.cpp +++ b/examples/NonArduino/ESP-IDF/main/main.cpp @@ -17,7 +17,7 @@ #include // include the hardware abstraction layer -#include "EspHal.h" +#include "hal/ESP-IDF/EspHal.h" // create a new instance of the HAL class EspHal* hal = new EspHal(5, 19, 27); diff --git a/examples/NonArduino/Pico/main.cpp b/examples/NonArduino/Pico/main.cpp index 28b32251..c0b007fa 100644 --- a/examples/NonArduino/Pico/main.cpp +++ b/examples/NonArduino/Pico/main.cpp @@ -41,7 +41,7 @@ #include // include the hardware abstraction layer -#include "PicoHal.h" +#include "hal/RPiPico/PicoHal.h" // create a new instance of the HAL class PicoHal* hal = new PicoHal(SPI_PORT, SPI_MISO, SPI_MOSI, SPI_SCK); diff --git a/examples/NonArduino/Raspberry/main.cpp b/examples/NonArduino/Raspberry/main.cpp index 1dfa60bf..702b1971 100644 --- a/examples/NonArduino/Raspberry/main.cpp +++ b/examples/NonArduino/Raspberry/main.cpp @@ -18,7 +18,7 @@ #include // include the hardware abstraction layer -#include "PiHal.h" +#include "hal/RPi/PiHal.h" // create a new instance of the HAL class // use SPI channel 1, because on Waveshare LoRaWAN Hat, diff --git a/examples/NonArduino/Tock/main.cpp b/examples/NonArduino/Tock/main.cpp index c8a5628d..e716d509 100644 --- a/examples/NonArduino/Tock/main.cpp +++ b/examples/NonArduino/Tock/main.cpp @@ -28,7 +28,7 @@ #include // include the hardware abstraction layer -#include "libtockHal.h" +#include "hal/Tock/libtockHal.h" // the entry point for the program int main(void) { diff --git a/src/Module.cpp b/src/Module.cpp index 33d9c09b..8cc308d2 100644 --- a/src/Module.cpp +++ b/src/Module.cpp @@ -5,7 +5,7 @@ #include #if defined(RADIOLIB_BUILD_ARDUINO) -#include "ArduinoHal.h" +#include "hal/Arduino/ArduinoHal.h" Module::Module(uint32_t cs, uint32_t irq, uint32_t rst, uint32_t gpio) : csPin(cs), irqPin(irq), rstPin(rst), gpioPin(gpio) { this->hal = new ArduinoHal(); diff --git a/src/RadioLib.h b/src/RadioLib.h index c416180b..bd6c9598 100644 --- a/src/RadioLib.h +++ b/src/RadioLib.h @@ -40,7 +40,7 @@ #include "Hal.h" #if defined(RADIOLIB_BUILD_ARDUINO) -#include "ArduinoHal.h" +#include "hal/Arduino/ArduinoHal.h" #endif diff --git a/src/ArduinoHal.cpp b/src/hal/Arduino/ArduinoHal.cpp similarity index 100% rename from src/ArduinoHal.cpp rename to src/hal/Arduino/ArduinoHal.cpp diff --git a/src/ArduinoHal.h b/src/hal/Arduino/ArduinoHal.h similarity index 100% rename from src/ArduinoHal.h rename to src/hal/Arduino/ArduinoHal.h diff --git a/examples/NonArduino/ESP-IDF/main/EspHal.h b/src/hal/ESP-IDF/EspHal.h similarity index 100% rename from examples/NonArduino/ESP-IDF/main/EspHal.h rename to src/hal/ESP-IDF/EspHal.h diff --git a/examples/NonArduino/Raspberry/PiHal.h b/src/hal/RPi/PiHal.h similarity index 100% rename from examples/NonArduino/Raspberry/PiHal.h rename to src/hal/RPi/PiHal.h diff --git a/examples/NonArduino/Pico/PicoHal.h b/src/hal/RPiPico/PicoHal.h similarity index 100% rename from examples/NonArduino/Pico/PicoHal.h rename to src/hal/RPiPico/PicoHal.h diff --git a/examples/NonArduino/Tock/libtockHal.h b/src/hal/Tock/libtockHal.h similarity index 100% rename from examples/NonArduino/Tock/libtockHal.h rename to src/hal/Tock/libtockHal.h diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index 1736f8c9..cfa96bb6 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -3601,7 +3601,9 @@ int16_t LR11x0::gnssWriteBitMaskSatActivated(uint8_t bitMask, uint32_t* bitMaskA void LR11x0::gnssAbort() { // send the abort signal (single NOP) this->mod->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_CMD] = Module::BITS_8; - this->mod->SPIwriteStream(RADIOLIB_LR11X0_CMD_NOP, NULL, 0, false, false); + // we need to call the most basic overload of the SPI write method otherwise the call will be ambiguous + uint8_t cmd[2] = { 0, 0 }; + this->mod->SPIwriteStream(cmd, 2, NULL, 0, false, false); this->mod->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_CMD] = Module::BITS_16; // wait for at least 2.9 seconds as specified by the user manual diff --git a/src/modules/SX126x/STM32WLx_Module.cpp b/src/modules/SX126x/STM32WLx_Module.cpp index 0f48d9aa..d2dd47d0 100644 --- a/src/modules/SX126x/STM32WLx_Module.cpp +++ b/src/modules/SX126x/STM32WLx_Module.cpp @@ -9,7 +9,7 @@ This file is licensed under the MIT License: https://opensource.org/licenses/MIT #if !RADIOLIB_EXCLUDE_STM32WLX -#include "../../ArduinoHal.h" +#include "hal/Arduino/ArduinoHal.h" // This defines some dummy pin numbers (starting at NUM_DIGITAL_PINS to // guarantee these are not valid regular pin numbers) that can be passed diff --git a/src/protocols/BellModem/BellModem.h b/src/protocols/BellModem/BellModem.h index 886e206e..e65f4117 100644 --- a/src/protocols/BellModem/BellModem.h +++ b/src/protocols/BellModem/BellModem.h @@ -3,9 +3,6 @@ #include "../../TypeDef.h" #include "../../Module.h" -#if defined(RADIOLIB_BUILD_ARDUINO) -#include "../../ArduinoHal.h" -#endif #if !RADIOLIB_EXCLUDE_BELL diff --git a/src/protocols/ExternalRadio/ExternalRadio.h b/src/protocols/ExternalRadio/ExternalRadio.h index 823674bc..86befabc 100644 --- a/src/protocols/ExternalRadio/ExternalRadio.h +++ b/src/protocols/ExternalRadio/ExternalRadio.h @@ -3,9 +3,6 @@ #include "../../TypeDef.h" #include "../../Module.h" -#if defined(RADIOLIB_BUILD_ARDUINO) -#include "../../ArduinoHal.h" -#endif #include "../PhysicalLayer/PhysicalLayer.h" diff --git a/src/utils/CRC.h b/src/utils/CRC.h index bec3d710..a93a0259 100644 --- a/src/utils/CRC.h +++ b/src/utils/CRC.h @@ -3,9 +3,6 @@ #include "../TypeDef.h" #include "../Module.h" -#if defined(RADIOLIB_BUILD_ARDUINO) -#include "../ArduinoHal.h" -#endif // CCITT CRC properties (used by AX.25) #define RADIOLIB_CRC_CCITT_POLY (0x1021) diff --git a/src/utils/FEC.h b/src/utils/FEC.h index 9b9e99c3..7e134124 100644 --- a/src/utils/FEC.h +++ b/src/utils/FEC.h @@ -3,9 +3,6 @@ #include "../TypeDef.h" #include "../Module.h" -#if defined(RADIOLIB_BUILD_ARDUINO) -#include "../ArduinoHal.h" -#endif // BCH(31, 21) code constants #define RADIOLIB_PAGER_BCH_N (31)