Browse Source

Merged in laurisievins/espurna/pulse_fix (pull request #20)

Each relay has its own pulse ticker.

Approved-by: Xose Pérez <xose.perez@gmail.com>
fastled
Lauris Ieviņš 7 years ago
committed by Xose Pérez
parent
commit
f0c1f591a9
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      code/espurna/relay.ino

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

@ -21,9 +21,9 @@ typedef struct {
unsigned int scheduledStatusTime;
bool scheduledStatus;
bool scheduledReport;
Ticker pulseTicker;
} relay_t;
std::vector<relay_t> _relays;
Ticker pulseTicker;
bool recursive = false;
#if RELAY_PROVIDER == RELAY_PROVIDER_DUAL
@ -105,11 +105,11 @@ void relayPulse(unsigned char id) {
bool status = relayStatus(id);
bool pulseStatus = (relayPulseMode == RELAY_PULSE_ON);
if (pulseStatus == status) {
pulseTicker.detach();
_relays[id].pulseTicker.detach();
return;
}
pulseTicker.once(
_relays[id].pulseTicker.once(
getSetting("relayPulseTime", RELAY_PULSE_TIME).toInt(),
relayToggle,
id


Loading…
Cancel
Save