mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-22 21:14:50 +00:00
#654 Fix gpio initilization
This commit is contained in:
parent
85752b0fc7
commit
9e736ab0d7
@ -27,7 +27,7 @@ This plugin supports:
|
|||||||
|
|
||||||
#define EXT_NOTIFICATION_PLUGIN_ENABLED 0
|
#define EXT_NOTIFICATION_PLUGIN_ENABLED 0
|
||||||
#define EXT_NOTIFICATION_PLUGIN_ACTIVE 0
|
#define EXT_NOTIFICATION_PLUGIN_ACTIVE 0
|
||||||
#define EXT_NOTIFICATION_PLUGIN_ALERT_MESSAGE 1
|
#define EXT_NOTIFICATION_PLUGIN_ALERT_MESSAGE 0
|
||||||
#define EXT_NOTIFICATION_PLUGIN_ALERT_BELL 0
|
#define EXT_NOTIFICATION_PLUGIN_ALERT_BELL 0
|
||||||
#define EXT_NOTIFICATION_PLUGIN_OUTPUT 13
|
#define EXT_NOTIFICATION_PLUGIN_OUTPUT 13
|
||||||
#define EXT_NOTIFICATION_PLUGIN_OUTPUT_MS 1000
|
#define EXT_NOTIFICATION_PLUGIN_OUTPUT_MS 1000
|
||||||
@ -63,19 +63,14 @@ int32_t ExternalNotificationPlugin::runOnce()
|
|||||||
// Set the direction of a pin
|
// Set the direction of a pin
|
||||||
pinMode(EXT_NOTIFICATION_PLUGIN_OUTPUT, OUTPUT);
|
pinMode(EXT_NOTIFICATION_PLUGIN_OUTPUT, OUTPUT);
|
||||||
|
|
||||||
// if ext_notification_plugin_active
|
// Turn off the pin
|
||||||
if (EXT_NOTIFICATION_PLUGIN_ACTIVE) {
|
|
||||||
setExternalOff();
|
setExternalOff();
|
||||||
} else {
|
|
||||||
setExternalOn();
|
|
||||||
}
|
|
||||||
|
|
||||||
externalNotificationPluginRadio = new ExternalNotificationPluginRadio();
|
externalNotificationPluginRadio = new ExternalNotificationPluginRadio();
|
||||||
|
|
||||||
firstTime = 0;
|
firstTime = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// DEBUG_MSG("EN Loop\n");
|
|
||||||
if (externalCurrentState) {
|
if (externalCurrentState) {
|
||||||
|
|
||||||
// TODO: Test this part. Don't know if this should be greater than or less than.
|
// TODO: Test this part. Don't know if this should be greater than or less than.
|
||||||
@ -131,7 +126,7 @@ bool ExternalNotificationPluginRadio::handleReceived(const MeshPacket &mp)
|
|||||||
if (EXT_NOTIFICATION_PLUGIN_ENABLED) {
|
if (EXT_NOTIFICATION_PLUGIN_ENABLED) {
|
||||||
|
|
||||||
auto &p = mp.decoded.data;
|
auto &p = mp.decoded.data;
|
||||||
//DEBUG_MSG("Processing handleReceived\n");
|
// DEBUG_MSG("Processing handleReceived\n");
|
||||||
|
|
||||||
if (mp.from != nodeDB.getNodeNum()) {
|
if (mp.from != nodeDB.getNodeNum()) {
|
||||||
DEBUG_MSG("handleReceived from some other device\n");
|
DEBUG_MSG("handleReceived from some other device\n");
|
||||||
@ -145,7 +140,7 @@ bool ExternalNotificationPluginRadio::handleReceived(const MeshPacket &mp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (EXT_NOTIFICATION_PLUGIN_ALERT_MESSAGE) {
|
if (EXT_NOTIFICATION_PLUGIN_ALERT_MESSAGE) {
|
||||||
//DEBUG_MSG("Turning on alert\n");
|
// DEBUG_MSG("Turning on alert\n");
|
||||||
externalNotificationPlugin->setExternalOn();
|
externalNotificationPlugin->setExternalOn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user