From 92a43685a87318a31022594c9cb7d43cf06175c6 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 28 Jan 2023 09:13:01 -0600 Subject: [PATCH] Modules --- src/modules/Modules.cpp | 72 +++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index ee7587112..f02d01b86 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -8,7 +8,6 @@ #include "modules/NodeInfoModule.h" #include "modules/PositionModule.h" #include "modules/RemoteHardwareModule.h" -#include "modules/RepeaterModule.h" #include "modules/ReplyModule.h" #include "modules/RoutingModule.h" #include "modules/TextMessageModule.h" @@ -34,56 +33,59 @@ */ void setupModules() { - if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) { + if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) + { #if HAS_BUTTON - inputBroker = new InputBroker(); + inputBroker = new InputBroker(); #endif - adminModule = new AdminModule(); - nodeInfoModule = new NodeInfoModule(); - positionModule = new PositionModule(); - waypointModule = new WaypointModule(); - textMessageModule = new TextMessageModule(); - traceRouteModule = new TraceRouteModule(); + adminModule = new AdminModule(); + nodeInfoModule = new NodeInfoModule(); + positionModule = new PositionModule(); + waypointModule = new WaypointModule(); + textMessageModule = new TextMessageModule(); + traceRouteModule = new TraceRouteModule(); - // Note: if the rest of meshtastic doesn't need to explicitly use your module, you do not need to assign the instance - // to a global variable. + // Note: if the rest of meshtastic doesn't need to explicitly use your module, you do not need to assign the instance + // to a global variable. - new RemoteHardwareModule(); - new ReplyModule(); + new RemoteHardwareModule(); + new ReplyModule(); #if HAS_BUTTON - rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); - rotaryEncoderInterruptImpl1->init(); - upDownInterruptImpl1 = new UpDownInterruptImpl1(); - upDownInterruptImpl1->init(); - cardKbI2cImpl = new CardKbI2cImpl(); - cardKbI2cImpl->init(); + rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); + rotaryEncoderInterruptImpl1->init(); + upDownInterruptImpl1 = new UpDownInterruptImpl1(); + upDownInterruptImpl1->init(); + cardKbI2cImpl = new CardKbI2cImpl(); + cardKbI2cImpl->init(); #endif #if HAS_SCREEN - cannedMessageModule = new CannedMessageModule(); + cannedMessageModule = new CannedMessageModule(); #endif #if HAS_TELEMETRY - new DeviceTelemetryModule(); - new EnvironmentTelemetryModule(); + new DeviceTelemetryModule(); + new EnvironmentTelemetryModule(); #endif #if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2) - new SerialModule(); + new SerialModule(); #endif #ifdef ARCH_ESP32 - // Only run on an esp32 based device. - audioModule = new AudioModule(); - externalNotificationModule = new ExternalNotificationModule(); + // Only run on an esp32 based device. + audioModule = new AudioModule(); + externalNotificationModule = new ExternalNotificationModule(); - storeForwardModule = new StoreForwardModule(); + storeForwardModule = new StoreForwardModule(); - new RangeTestModule(); + new RangeTestModule(); #elif defined(ARCH_NRF52) - externalNotificationModule = new ExternalNotificationModule(); + externalNotificationModule = new ExternalNotificationModule(); #endif - // NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra - // acks - } else { - adminModule = new AdminModule(); - } - routingModule = new RoutingModule(); + // NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra + // acks + } + else + { + adminModule = new AdminModule(); + } + routingModule = new RoutingModule(); }