From 89599c9fd644c921df4e356cf2703457b1413e38 Mon Sep 17 00:00:00 2001 From: Thomas Kuschel Date: Sun, 18 Oct 2026 01:27:07 +0200 Subject: [PATCH] FIX include of lora.hpp in cli --- src/cli.hpp | 7 +++++++ src/main.cpp | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/cli.hpp b/src/cli.hpp index e70c746..68ca17d 100644 --- a/src/cli.hpp +++ b/src/cli.hpp @@ -13,6 +13,7 @@ #include "i2c.hpp" #include "led.hpp" #include "display.hpp" +#include "lora.hpp" /** * @brief Store peripheral, display, and hardware tracking references for CLI access. @@ -22,6 +23,12 @@ */ void cli_init(i2c* bus_pointer, LedController* led_pointer, DisplayController* display_pointer); +/** + * @brief Connects the asynchronous LoRa subsystem reference context back onto the interface layer. + * @param lora_pointer Active LoRa transceiver module controller layer instance. + */ +void cli_init_lora(LoraController* lora_pointer); + /** * @brief Registers the background tasks and setup routines for core runtime execution. */ diff --git a/src/main.cpp b/src/main.cpp index 1811f91..e075a76 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,7 @@ #include "cli.hpp" #include "i2c.hpp" #include "display.hpp" // FIXED: Added missing header for DisplayController +#include "lora.hpp" /** * @brief Global log categorization tag context for the main application loader. @@ -35,6 +36,11 @@ i2c* i2c_bus = nullptr; */ DisplayController* display = nullptr; +/** + * @brief Global pointer tracking the Semtech SX1276 core radio frquency +*/ +LoraController* lora_module = nullptr; + /** * @brief Static singleton instance governing hardware status LED blink patterns. */ @@ -104,6 +110,20 @@ extern "C" { // Spin up the background console interface thread on Core 0 start_cli_task(); + // LORA initialization and activation + lora_module = new LoraController(); + + if (lora_module != nullptr) { + //connects the lora instance with the CLI control directly (commands freq and bw) + cli_init_lora(lora_module); + + // start the radio task strict to the Core 1 (Priority 6) + lora_module->startTask(6); + ESP_LOGI(TAG, "LoRa subsystem successfully activated on Core 1."); + } else { + ESP_LOGI(TAG, "Critical: Failed to allocate memory for LoraController!"); + } + // Trigger synchronous welcome splash screen frame if (display != nullptr) { char msg[32];