Browse Source

Fix latched pulse always being HIGH (#2145)

see https://gitter.im/tinkerman-cat/espurna?at=5e44563355b6b04bf6aac94b
mcspr-patch-1
Max Prokhorov 4 years ago
committed by GitHub
parent
commit
0d5129db4d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      code/espurna/relay.ino

+ 1
- 1
code/espurna/relay.ino View File

@ -301,7 +301,7 @@ void _relayProviderStatus(unsigned char id, bool status) {
} else if (_relays[id].type == RELAY_TYPE_INVERSE) {
digitalWrite(_relays[id].pin, !status);
} else if (_relays[id].type == RELAY_TYPE_LATCHED || _relays[id].type == RELAY_TYPE_LATCHED_INVERSE) {
bool pulse = RELAY_TYPE_LATCHED ? HIGH : LOW;
bool pulse = (_relays[id].type == RELAY_TYPE_LATCHED) ? HIGH : LOW;
digitalWrite(_relays[id].pin, !pulse);
if (GPIO_NONE != _relays[id].reset_pin) digitalWrite(_relays[id].reset_pin, !pulse);
if (status || (GPIO_NONE == _relays[id].reset_pin)) {


Loading…
Cancel
Save