From 9407952ec25df95448ef77958becba899c32d8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sat, 18 Aug 2018 08:21:58 +0200 Subject: [PATCH] Add yield to the parse loop This is to avoid famishin the WiFi stack. Fixes #131 --- library.json | 2 +- library.properties | 2 +- src/OpenWeatherMapCurrent.cpp | 2 ++ src/OpenWeatherMapForecast.cpp | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 31fe7dc..228e41b 100644 --- a/library.json +++ b/library.json @@ -15,5 +15,5 @@ "espressif8266", "espressif32" ], - "version": "1.6.1" + "version": "1.6.2" } diff --git a/library.properties b/library.properties index e426589..8f4b14d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP8266 Weather Station -version=1.6.1 +version=1.6.2 author=ThingPulse maintainer=ThingPulse sentence=ESP8266 based internet connected Weather Station diff --git a/src/OpenWeatherMapCurrent.cpp b/src/OpenWeatherMapCurrent.cpp index 151911c..0de3e61 100644 --- a/src/OpenWeatherMapCurrent.cpp +++ b/src/OpenWeatherMapCurrent.cpp @@ -80,6 +80,8 @@ void OpenWeatherMapCurrent::doUpdate(OpenWeatherMapCurrentData *data, String url if (isBody) { parser.parse(c); } + // give WiFi and TCP/IP libraries a chance to handle pending events + yield(); } } } diff --git a/src/OpenWeatherMapForecast.cpp b/src/OpenWeatherMapForecast.cpp index febf1ee..0b8bb2c 100644 --- a/src/OpenWeatherMapForecast.cpp +++ b/src/OpenWeatherMapForecast.cpp @@ -83,6 +83,8 @@ uint8_t OpenWeatherMapForecast::doUpdate(OpenWeatherMapForecastData *data, Strin if (isBody) { parser.parse(c); } + // give WiFi and TCP/IP libraries a chance to handle pending events + yield(); } } }