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(); } }