From b0a781f59e05f5343f974ef29ad84919d0c427a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 8 Feb 2017 14:21:32 +0100 Subject: [PATCH] Relay pulse using ticker.once --- code/espurna/relay.ino | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino index 4ad4d9e6..8e262d3a 100644 --- a/code/espurna/relay.ino +++ b/code/espurna/relay.ino @@ -52,11 +52,6 @@ bool relayStatus(unsigned char id) { #endif } -void relayPulseBack(unsigned char id) { - relayToggle(id); - pulseTicker.detach(); -} - void relayPulse(unsigned char id) { byte relayPulseMode = getSetting("relayPulseMode", RELAY_PULSE_MODE).toInt(); @@ -69,9 +64,9 @@ void relayPulse(unsigned char id) { return; } - pulseTicker.attach( + pulseTicker.once( getSetting("relayPulseTime", RELAY_PULSE_TIME).toInt(), - relayPulseBack, + relayToggle, id );