From 2bccfb09e49c147c842153f050f775edc389b725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 26 Jul 2018 13:00:40 +0200 Subject: [PATCH] Init relay GPIO when in inverse mode to be OFF (#1078) --- code/espurna/relay.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino index 6f5a5d76..69c686b9 100644 --- a/code/espurna/relay.ino +++ b/code/espurna/relay.ino @@ -521,6 +521,10 @@ void _relayConfigure() { if (GPIO_NONE != _relays[i].reset_pin) { pinMode(_relays[i].reset_pin, OUTPUT); } + if (_relays[i].type == RELAY_TYPE_INVERSE) { + //set to high to block short opening of relay + digitalWrite(_relays[i].pin, HIGH); + } _relays[i].pulse = getSetting("relayPulse", i, RELAY_PULSE_MODE).toInt(); _relays[i].pulse_ms = 1000 * getSetting("relayTime", i, RELAY_PULSE_MODE).toFloat(); }