don't depend on EXT_NOTIFY_OUT being defined.

This commit is contained in:
Thomas Göttgens 2022-10-22 13:45:43 +02:00
parent d4ddcdd91e
commit d817889255
2 changed files with 2 additions and 12 deletions

View File

@ -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
}

View File

@ -12,7 +12,7 @@
*/
class ExternalNotificationModule : public SinglePortModule, private concurrency::OSThread
{
uint32_t output = EXT_NOTIFY_OUT;
uint32_t output = 0;
public:
ExternalNotificationModule();