Browse Source

Each relay has its own pulse ticker. This fixes issue #149

fastled
Lauris 7 years ago
parent
commit
2eed5f4ac2
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