mirror of https://github.com/arendst/Tasmota.git
Add esp8266 de-blocking
Solve possible PubSubClient timeout due to esp8266 blocking (#790)
This commit is contained in:
parent
33e116ccb9
commit
5d9dab9340
|
@ -209,6 +209,7 @@ boolean PubSubClient::connect(const char *id, const char *user, const char *pass
|
|||
boolean PubSubClient::readByte(uint8_t * result) {
|
||||
uint32_t previousMillis = millis();
|
||||
while(!_client->available()) {
|
||||
delay(1); // Add esp8266 de-blocking (Tasmota #790)
|
||||
uint32_t currentMillis = millis();
|
||||
if(currentMillis - previousMillis >= ((int32_t) MQTT_SOCKET_TIMEOUT * 1000)){
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue