2021-06-27 10:56:28 -07:00
|
|
|
#include "configuration.h"
|
2022-01-13 14:06:10 +01:00
|
|
|
#include "input/InputBroker.h"
|
|
|
|
|
#include "input/RotaryEncoderInterruptImpl1.h"
|
2022-03-26 17:45:42 +01:00
|
|
|
#include "input/UpDownInterruptImpl1.h"
|
2022-03-28 16:55:58 +02:00
|
|
|
#include "input/cardKbI2cImpl.h"
|
|
|
|
|
#include "input/facesKbI2cImpl.h"
|
2022-02-27 00:18:35 -08:00
|
|
|
#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"
|
2022-08-22 16:41:23 -05:00
|
|
|
#include "modules/WaypointModule.h"
|
2022-07-31 07:11:47 -05:00
|
|
|
#if HAS_TELEMETRY
|
2022-08-22 16:41:23 -05:00
|
|
|
#include "modules/Telemetry/DeviceTelemetry.h"
|
2022-03-27 14:55:35 +00:00
|
|
|
#include "modules/Telemetry/EnvironmentTelemetry.h"
|
2022-01-23 10:05:39 -06:00
|
|
|
#endif
|
2022-07-31 07:11:47 -05:00
|
|
|
#ifdef ARCH_ESP32
|
2022-02-27 01:27:17 -08:00
|
|
|
#include "modules/esp32/RangeTestModule.h"
|
|
|
|
|
#include "modules/esp32/SerialModule.h"
|
|
|
|
|
#include "modules/esp32/StoreForwardModule.h"
|
2021-02-16 18:07:02 -08:00
|
|
|
#endif
|
2022-08-23 13:16:20 -05:00
|
|
|
#if defined(ARCH_ESP32) || defined(ARCH_NRF52)
|
|
|
|
|
#include "modules/ExternalNotificationModule.h"
|
|
|
|
|
#endif
|
2021-01-08 13:15:49 +08:00
|
|
|
/**
|
2022-02-27 00:29:05 -08:00
|
|
|
* Create module instances here. If you are adding a new module, you must 'new' it here (or somewhere else)
|
2021-01-08 13:15:49 +08:00
|
|
|
*/
|
2022-02-27 01:49:24 -08:00
|
|
|
void setupModules()
|
2021-01-16 22:27:33 -08:00
|
|
|
{
|
2022-07-31 07:11:47 -05:00
|
|
|
#if HAS_BUTTON
|
2022-01-11 16:02:55 +01:00
|
|
|
inputBroker = new InputBroker();
|
2022-07-31 07:11:47 -05:00
|
|
|
#endif
|
2022-02-27 02:21:02 -08:00
|
|
|
adminModule = new AdminModule();
|
|
|
|
|
nodeInfoModule = new NodeInfoModule();
|
|
|
|
|
positionModule = new PositionModule();
|
2022-08-22 16:41:23 -05:00
|
|
|
waypointModule = new WaypointModule();
|
2022-02-27 02:21:02 -08:00
|
|
|
textMessageModule = new TextMessageModule();
|
2022-02-24 20:05:27 -08:00
|
|
|
|
2022-02-27 00:29:05 -08:00
|
|
|
// Note: if the rest of meshtastic doesn't need to explicitly use your module, you do not need to assign the instance
|
2021-01-08 13:15:49 +08:00
|
|
|
// to a global variable.
|
|
|
|
|
|
2022-02-27 02:21:02 -08:00
|
|
|
new RemoteHardwareModule();
|
|
|
|
|
new ReplyModule();
|
2022-07-31 07:11:47 -05:00
|
|
|
#if HAS_BUTTON
|
2022-02-19 23:43:32 -08:00
|
|
|
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
|
2022-01-12 09:26:42 +01:00
|
|
|
rotaryEncoderInterruptImpl1->init();
|
2022-03-26 17:45:42 +01:00
|
|
|
upDownInterruptImpl1 = new UpDownInterruptImpl1();
|
|
|
|
|
upDownInterruptImpl1->init();
|
2022-03-28 16:55:58 +02:00
|
|
|
cardKbI2cImpl = new CardKbI2cImpl();
|
|
|
|
|
cardKbI2cImpl->init();
|
|
|
|
|
facesKbI2cImpl = new FacesKbI2cImpl();
|
|
|
|
|
facesKbI2cImpl->init();
|
2022-07-31 07:11:47 -05:00
|
|
|
#endif
|
|
|
|
|
#if HAS_SCREEN
|
2022-02-27 01:20:23 -08:00
|
|
|
cannedMessageModule = new CannedMessageModule();
|
2022-05-06 15:41:37 +02:00
|
|
|
#endif
|
2022-07-31 07:11:47 -05:00
|
|
|
#if HAS_TELEMETRY
|
2022-03-27 14:55:35 +00:00
|
|
|
new DeviceTelemetryModule();
|
|
|
|
|
new EnvironmentTelemetryModule();
|
2022-01-23 10:05:39 -06:00
|
|
|
#endif
|
2022-07-31 07:11:47 -05:00
|
|
|
#ifdef ARCH_ESP32
|
2021-01-16 22:27:33 -08:00
|
|
|
// Only run on an esp32 based device.
|
|
|
|
|
|
2021-01-31 09:12:36 -08:00
|
|
|
/*
|
|
|
|
|
Maintained by MC Hamster (Jm Casler) jm@casler.org
|
|
|
|
|
*/
|
2022-02-27 02:21:02 -08:00
|
|
|
new SerialModule();
|
2022-02-27 01:49:24 -08:00
|
|
|
new ExternalNotificationModule();
|
2021-02-14 13:31:11 -08:00
|
|
|
|
2022-02-27 02:21:02 -08:00
|
|
|
storeForwardModule = new StoreForwardModule();
|
2021-02-14 13:31:11 -08:00
|
|
|
|
2022-02-27 01:49:24 -08:00
|
|
|
new RangeTestModule();
|
2022-08-22 16:41:23 -05:00
|
|
|
#elif defined(ARCH_NRF52)
|
|
|
|
|
new ExternalNotificationModule();
|
2021-01-16 22:27:33 -08:00
|
|
|
#endif
|
2021-03-05 11:44:45 +08:00
|
|
|
|
2022-02-27 00:29:05 -08: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 02:21:02 -08:00
|
|
|
routingModule = new RoutingModule();
|
2022-03-31 16:27:55 -05:00
|
|
|
}
|