From c2b3ff1fd22da2f53cad16c667ddd8b0f3f50577 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Wed, 25 Jul 2018 10:35:36 +0200 Subject: [PATCH] Fix yield exception Fix yield exception using non PubSubClient library --- sonoff/xdrv_01_mqtt.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonoff/xdrv_01_mqtt.ino b/sonoff/xdrv_01_mqtt.ino index 8afcf672b..e91e56f16 100644 --- a/sonoff/xdrv_01_mqtt.ino +++ b/sonoff/xdrv_01_mqtt.ino @@ -92,7 +92,9 @@ void MqttSubscribeLib(char *topic) bool MqttPublishLib(const char* topic, boolean retained) { - return MqttClient.publish(topic, mqtt_data, retained); + bool result = MqttClient.publish(topic, mqtt_data, retained); + yield(); // #3313 + return result; } void MqttLoop() @@ -231,8 +233,6 @@ void MqttPublishDirect(const char* topic, boolean retained) if (Settings.ledstate &0x04) { blinks++; } - - yield(); // #3313 } void MqttPublish(const char* topic, boolean retained)