mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-03 03:09:59 +00:00
#654 - Small changes.
This commit is contained in:
parent
eff0c1fe89
commit
2246564279
@ -36,7 +36,7 @@ int32_t ExternalNotificationPlugin::runOnce()
|
||||
// radioConfig.preferences.externalnotificationplugin_enabled = 1;
|
||||
// radioConfig.preferences.externalnotificationplugin_mode = 1;
|
||||
|
||||
if (0) {
|
||||
if (1) {
|
||||
|
||||
if (firstTime) {
|
||||
|
||||
@ -46,6 +46,16 @@ int32_t ExternalNotificationPlugin::runOnce()
|
||||
|
||||
firstTime = 0;
|
||||
|
||||
// Set the direction of a pin
|
||||
pinMode(13, OUTPUT);
|
||||
|
||||
// if ext_notification_plugin_active
|
||||
if (1) {
|
||||
setExternalOff();
|
||||
} else {
|
||||
setExternalOn();
|
||||
}
|
||||
|
||||
} else {
|
||||
/*
|
||||
|
||||
@ -66,6 +76,27 @@ int32_t ExternalNotificationPlugin::runOnce()
|
||||
#endif
|
||||
}
|
||||
|
||||
void ExternalNotificationPlugin::setExternalOn()
|
||||
{
|
||||
// if ext_notification_plugin_active
|
||||
if (1) {
|
||||
digitalWrite(13, true);
|
||||
|
||||
} else {
|
||||
digitalWrite(13, false);
|
||||
}
|
||||
}
|
||||
|
||||
void ExternalNotificationPlugin::setExternalOff()
|
||||
{
|
||||
// if ext_notification_plugin_active
|
||||
if (1) {
|
||||
digitalWrite(13, false);
|
||||
} else {
|
||||
digitalWrite(13, true);
|
||||
}
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
MeshPacket *ExternalNotificationPluginRadio::allocReply()
|
||||
@ -80,7 +111,7 @@ bool ExternalNotificationPluginRadio::handleReceived(const MeshPacket &mp)
|
||||
{
|
||||
#ifndef NO_ESP32
|
||||
|
||||
if (0) {
|
||||
if (1) {
|
||||
|
||||
auto &p = mp.decoded.data;
|
||||
|
||||
@ -95,6 +126,9 @@ bool ExternalNotificationPluginRadio::handleReceived(const MeshPacket &mp)
|
||||
TODO: If ext_notification_plugin_alert_message is true, trigger an external notification.
|
||||
*/
|
||||
// TODO: On received packet, blink the LED.
|
||||
externalNotificationPlugin->setExternalOn();
|
||||
delay(500);
|
||||
externalNotificationPlugin->setExternalOff();
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,9 @@ class ExternalNotificationPlugin : private concurrency::OSThread
|
||||
public:
|
||||
ExternalNotificationPlugin();
|
||||
|
||||
void setExternalOn();
|
||||
void setExternalOff();
|
||||
|
||||
protected:
|
||||
virtual int32_t runOnce();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user