Browse Source

Init relay GPIO when in inverse mode to be OFF (#1078)

ech1560
Xose Pérez 6 years ago
parent
commit
2bccfb09e4
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      code/espurna/relay.ino

+ 4
- 0
code/espurna/relay.ino View File

@ -521,6 +521,10 @@ void _relayConfigure() {
if (GPIO_NONE != _relays[i].reset_pin) { if (GPIO_NONE != _relays[i].reset_pin) {
pinMode(_relays[i].reset_pin, OUTPUT); 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 = getSetting("relayPulse", i, RELAY_PULSE_MODE).toInt();
_relays[i].pulse_ms = 1000 * getSetting("relayTime", i, RELAY_PULSE_MODE).toFloat(); _relays[i].pulse_ms = 1000 * getSetting("relayTime", i, RELAY_PULSE_MODE).toFloat();
} }


Loading…
Cancel
Save