From 619ff8762661b00cea06e51f50894ffc7da5a43b Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Fri, 18 Jan 2019 11:31:15 +0100 Subject: [PATCH] Fix pulse for dummy relays --- code/espurna/relay.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino index f91055f6..87514dfc 100644 --- a/code/espurna/relay.ino +++ b/code/espurna/relay.ino @@ -552,6 +552,9 @@ void _relayBoot() { void _relayConfigure() { for (unsigned int i=0; i<_relays.size(); i++) { + _relays[i].pulse = getSetting("relayPulse", i, RELAY_PULSE_MODE).toInt(); + _relays[i].pulse_ms = 1000 * getSetting("relayTime", i, RELAY_PULSE_MODE).toFloat(); + if (GPIO_NONE == _relays[i].pin) continue; pinMode(_relays[i].pin, OUTPUT); @@ -562,8 +565,6 @@ void _relayConfigure() { //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(); } }