From 05ad173a05106fb313353c8e2caa3729f39ba8ec Mon Sep 17 00:00:00 2001 From: c03rad0r Date: Sun, 28 Jun 2026 05:06:42 +0530 Subject: [PATCH] refactor: move EspIdfHal.h to src/helpers/radiolib/ per reviewer suggestion Move the ESP-IDF SPI HAL from the variant-specific directory to the shared helpers/radiolib/ directory, making it available for reuse by other ESP32 variants that may need the same SPI workaround. Addresses feedback from @ripplebiz: 'I'd probably move the IDF Hal to /src/helpers/radiolib, as it's related only to RadioLib and could potentially be re-used by other variants' Also update the include path in target.cpp to use the shared location. --- {variants/nicerf_lr2021 => src/helpers/radiolib}/EspIdfHal.h | 0 variants/nicerf_lr2021/target.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {variants/nicerf_lr2021 => src/helpers/radiolib}/EspIdfHal.h (100%) diff --git a/variants/nicerf_lr2021/EspIdfHal.h b/src/helpers/radiolib/EspIdfHal.h similarity index 100% rename from variants/nicerf_lr2021/EspIdfHal.h rename to src/helpers/radiolib/EspIdfHal.h diff --git a/variants/nicerf_lr2021/target.cpp b/variants/nicerf_lr2021/target.cpp index 8737d6a0..bae0ff40 100644 --- a/variants/nicerf_lr2021/target.cpp +++ b/variants/nicerf_lr2021/target.cpp @@ -8,7 +8,7 @@ NiceRFLR2021Board board; // your board, define USE_ESPIDF_HAL in platformio.ini to use the ESP-IDF SPI // HAL workaround (see EspIdfHal.h for details). #ifdef USE_ESPIDF_HAL -#include "EspIdfHal.h" +#include static EspIdfHal hal(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); RADIO_CLASS radio(new Module(&hal, P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY));