From d8178892552be507b0bd527ba5f3bc032067cbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 22 Oct 2022 13:45:43 +0200 Subject: [PATCH] don't depend on EXT_NOTIFY_OUT being defined. --- src/modules/ExternalNotificationModule.cpp | 10 ---------- src/modules/ExternalNotificationModule.h | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index dbe8e01f4..90fbf28f0 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -91,23 +91,19 @@ int32_t ExternalNotificationModule::runOnce() void ExternalNotificationModule::setExternalOn() { -#ifdef EXT_NOTIFY_OUT externalCurrentState = 1; externalTurnedOn = millis(); digitalWrite(output, (moduleConfig.external_notification.active ? true : false)); -#endif } void ExternalNotificationModule::setExternalOff() { -#ifdef EXT_NOTIFY_OUT externalCurrentState = 0; digitalWrite(output, (moduleConfig.external_notification.active ? false : true)); -#endif } // -------- @@ -119,8 +115,6 @@ ExternalNotificationModule::ExternalNotificationModule() // restrict to the admin channel for rx boundChannel = Channels::gpioChannel; -#ifdef EXT_NOTIFY_OUT - /* Uncomment the preferences below if you want to use the module without having to configure it from the PythonAPI or WebUI. @@ -155,13 +149,10 @@ ExternalNotificationModule::ExternalNotificationModule() DEBUG_MSG("External Notification Module Disabled\n"); enabled = false; } -#endif } ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp) { -#ifdef EXT_NOTIFY_OUT - if (moduleConfig.external_notification.enabled) { if (getFrom(&mp) != nodeDB.getNodeNum()) { @@ -195,7 +186,6 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp) } else { DEBUG_MSG("External Notification Module Disabled\n"); } -#endif return ProcessMessage::CONTINUE; // Let others look at this message also if they want } diff --git a/src/modules/ExternalNotificationModule.h b/src/modules/ExternalNotificationModule.h index 6fb45e7e2..b5ab64b3c 100644 --- a/src/modules/ExternalNotificationModule.h +++ b/src/modules/ExternalNotificationModule.h @@ -12,8 +12,8 @@ */ class ExternalNotificationModule : public SinglePortModule, private concurrency::OSThread { - uint32_t output = EXT_NOTIFY_OUT; - + uint32_t output = 0; + public: ExternalNotificationModule();