From 9aa586a8b3a9bfa557cb4b1329c8d6c3ce2a3de5 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Sat, 1 Dec 2018 14:16:32 +0300 Subject: [PATCH] Fix wrong GPIO value for dummy relay --- code/espurna/relay.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino index acd3f36c..64247afd 100644 --- a/code/espurna/relay.ino +++ b/code/espurna/relay.ino @@ -557,6 +557,8 @@ void _relayBoot() { void _relayConfigure() { for (unsigned int i=0; i<_relays.size(); i++) { + if (GPIO_NONE == _relays[i].pin) continue; + pinMode(_relays[i].pin, OUTPUT); if (GPIO_NONE != _relays[i].reset_pin) { pinMode(_relays[i].reset_pin, OUTPUT); @@ -1006,7 +1008,7 @@ void relaySetup() { // No delay_on or off for these devices to easily allow having more than // 8 channels. This behaviour will be recovered with v2. for (unsigned char i=0; i < DUMMY_RELAY_COUNT; i++) { - _relays.push_back((relay_t) {0, RELAY_TYPE_NORMAL, 0, 0, 0}); + _relays.push_back((relay_t) {GPIO_NONE, RELAY_TYPE_NORMAL, 0, 0, 0}); } #else