Browse Source

Fix pulse for dummy relays

sensors
Niek van der Maas 6 years ago
parent
commit
619ff87626
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      code/espurna/relay.ino

+ 3
- 2
code/espurna/relay.ino View File

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


Loading…
Cancel
Save