mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Update and configure ExNotify platforms
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
// Default configurations
|
||||
#define EXT_NOTIFICATION_PLUGIN_OUTPUT 13
|
||||
#define EXT_NOTIFICATION_PLUGIN_OUTPUT EXT_NOTIFY_PIN
|
||||
#define EXT_NOTIFICATION_PLUGIN_OUTPUT_MS 1000
|
||||
|
||||
#define ASCII_BELL 0x07
|
||||
@@ -84,21 +84,25 @@ int32_t ExternalNotificationPlugin::runOnce()
|
||||
|
||||
void ExternalNotificationPlugin::setExternalOn()
|
||||
{
|
||||
#ifdef EXT_NOTIFY_PIN
|
||||
externalCurrentState = 1;
|
||||
externalTurnedOn = millis();
|
||||
|
||||
digitalWrite((radioConfig.preferences.ext_notification_plugin_output ? radioConfig.preferences.ext_notification_plugin_output
|
||||
: EXT_NOTIFICATION_PLUGIN_OUTPUT),
|
||||
(radioConfig.preferences.ext_notification_plugin_active ? true : false));
|
||||
#endif
|
||||
}
|
||||
|
||||
void ExternalNotificationPlugin::setExternalOff()
|
||||
{
|
||||
#ifdef EXT_NOTIFY_PIN
|
||||
externalCurrentState = 0;
|
||||
|
||||
digitalWrite((radioConfig.preferences.ext_notification_plugin_output ? radioConfig.preferences.ext_notification_plugin_output
|
||||
: EXT_NOTIFICATION_PLUGIN_OUTPUT),
|
||||
(radioConfig.preferences.ext_notification_plugin_active ? false : true));
|
||||
#endif
|
||||
}
|
||||
|
||||
// --------
|
||||
@@ -111,6 +115,7 @@ ExternalNotificationPlugin::ExternalNotificationPlugin()
|
||||
boundChannel = Channels::gpioChannel;
|
||||
|
||||
#ifndef NO_ESP32
|
||||
#ifdef EXT_NOTIFY_PIN
|
||||
|
||||
/*
|
||||
Uncomment the preferences below if you want to use the plugin
|
||||
@@ -140,12 +145,14 @@ ExternalNotificationPlugin::ExternalNotificationPlugin()
|
||||
DEBUG_MSG("External Notification Plugin Disabled\n");
|
||||
enabled = false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
ProcessMessage ExternalNotificationPlugin::handleReceived(const MeshPacket &mp)
|
||||
{
|
||||
#ifndef NO_ESP32
|
||||
#ifdef EXT_NOTIFY_PIN
|
||||
|
||||
if (radioConfig.preferences.ext_notification_plugin_enabled) {
|
||||
|
||||
@@ -173,6 +180,7 @@ ProcessMessage ExternalNotificationPlugin::handleReceived(const MeshPacket &mp)
|
||||
} else {
|
||||
DEBUG_MSG("External Notification Plugin Disabled\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user