From 97c1a2245bfb10dd0878fc0fa9c80cbc9904330d Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 18 Oct 2021 20:00:11 +0200 Subject: [PATCH] Too much yield()ing hutrs. --- usermods/multi_relay/usermod_multi_relay.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usermods/multi_relay/usermod_multi_relay.h b/usermods/multi_relay/usermod_multi_relay.h index 4a1feadd6..9d89f3d57 100644 --- a/usermods/multi_relay/usermod_multi_relay.h +++ b/usermods/multi_relay/usermod_multi_relay.h @@ -200,7 +200,6 @@ class MultiRelay : public Usermod { pinMode(_relay[relay].pin, OUTPUT); digitalWrite(_relay[relay].pin, mode ? !_relay[relay].mode : _relay[relay].mode); publishMqtt(mode ? "on" : "off", relay); - yield(); } /** @@ -288,6 +287,7 @@ class MultiRelay : public Usermod { * loop() is called continuously. Here you can check for events, read sensors, etc. */ void loop() { + yield(); if (!enabled || strip.isUpdating()) return; static unsigned long lastUpdate = 0; @@ -312,6 +312,7 @@ class MultiRelay : public Usermod { * Replicating button.cpp */ bool handleButton(uint8_t b) { + yield(); if (buttonType[b] == BTN_TYPE_NONE || buttonType[b] == BTN_TYPE_RESERVED || buttonType[b] == BTN_TYPE_PIR_SENSOR || buttonType[b] == BTN_TYPE_ANALOG || buttonType[b] == BTN_TYPE_ANALOG_INVERTED) { return false; }