firmware/src/modules/Modules.cpp

86 lines
2.6 KiB
C++
Raw Normal View History

#include "configuration.h"
2022-01-13 13:06:10 +00:00
#include "input/InputBroker.h"
#include "input/RotaryEncoderInterruptImpl1.h"
#include "input/UpDownInterruptImpl1.h"
#include "input/cardKbI2cImpl.h"
#include "modules/AdminModule.h"
#include "modules/CannedMessageModule.h"
#include "modules/NodeInfoModule.h"
#include "modules/PositionModule.h"
#include "modules/RemoteHardwareModule.h"
#include "modules/ReplyModule.h"
#include "modules/RoutingModule.h"
#include "modules/TextMessageModule.h"
#include "modules/WaypointModule.h"
#if HAS_TELEMETRY
#include "modules/Telemetry/DeviceTelemetry.h"
#include "modules/Telemetry/EnvironmentTelemetry.h"
#endif
#ifdef ARCH_ESP32
2022-02-27 09:27:17 +00:00
#include "modules/esp32/RangeTestModule.h"
#include "modules/esp32/StoreForwardModule.h"
#ifdef USE_SX1280
#include "modules/esp32/AudioModule.h"
#endif
2021-02-17 02:07:02 +00:00
#endif
#if defined(ARCH_ESP32) || defined(ARCH_NRF52)
#include "modules/ExternalNotificationModule.h"
2022-09-12 08:53:11 +00:00
#if !defined(TTGO_T_ECHO)
2022-09-12 08:08:32 +00:00
#include "modules/SerialModule.h"
#endif
2022-09-12 08:53:11 +00:00
#endif
/**
* Create module instances here. If you are adding a new module, you must 'new' it here (or somewhere else)
*/
2022-02-27 09:49:24 +00:00
void setupModules()
{
#if HAS_BUTTON
2022-01-11 15:02:55 +00:00
inputBroker = new InputBroker();
#endif
2022-02-27 10:21:02 +00:00
adminModule = new AdminModule();
nodeInfoModule = new NodeInfoModule();
positionModule = new PositionModule();
waypointModule = new WaypointModule();
2022-02-27 10:21:02 +00:00
textMessageModule = new TextMessageModule();
2022-02-25 04:05:27 +00:00
// 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.
2022-02-27 10:21:02 +00:00
new RemoteHardwareModule();
new ReplyModule();
#if HAS_BUTTON
2022-02-20 07:43:32 +00:00
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
2022-01-12 08:26:42 +00:00
rotaryEncoderInterruptImpl1->init();
upDownInterruptImpl1 = new UpDownInterruptImpl1();
upDownInterruptImpl1->init();
cardKbI2cImpl = new CardKbI2cImpl();
cardKbI2cImpl->init();
#endif
#if HAS_SCREEN
2022-02-27 09:20:23 +00:00
cannedMessageModule = new CannedMessageModule();
2022-05-06 13:41:37 +00:00
#endif
#if HAS_TELEMETRY
new DeviceTelemetryModule();
new EnvironmentTelemetryModule();
#endif
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO)
new SerialModule();
#endif
#ifdef ARCH_ESP32
// Only run on an esp32 based device.
#ifdef USE_SX1280
new AudioModule();
#endif
2022-02-27 09:49:24 +00:00
new ExternalNotificationModule();
2022-02-27 10:21:02 +00:00
storeForwardModule = new StoreForwardModule();
2022-02-27 09:49:24 +00:00
new RangeTestModule();
#elif defined(ARCH_NRF52)
new ExternalNotificationModule();
#endif
2021-03-05 03:44:45 +00:00
// NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra acks
2022-02-27 10:21:02 +00:00
routingModule = new RoutingModule();
}