Commit ef17fd9417d79e2c8203922ea9f81c2e9696595f

Authored by Jeroen88
1 parent adac3a6c

Added two times yield() for ESP8266 only

Showing 1 changed file with 6 additions and 0 deletions
src/EasyOpenTherm.cpp
@@ -190,6 +190,9 @@ bool OpenTherm::_execute(OTDataLinkLayer & da @@ -190,6 +190,9 @@ bool OpenTherm::_execute(OTDataLinkLayer & da
190 190
191 uint32_t startMillis = millis(); 191 uint32_t startMillis = millis();
192 for(;;) { 192 for(;;) {
  193 +#if defined(ESP8266)
  194 + yield();
  195 +#endif
193 if(millis() - startMillis >= _timeoutMs) { 196 if(millis() - startMillis >= _timeoutMs) {
194 _lastError = ERROR_CODES::SEND_TIMEOUT; 197 _lastError = ERROR_CODES::SEND_TIMEOUT;
195 198
@@ -203,6 +206,9 @@ bool OpenTherm::_execute(OTDataLinkLayer & da @@ -203,6 +206,9 @@ bool OpenTherm::_execute(OTDataLinkLayer & da
203 206
204 startMillis = millis(); 207 startMillis = millis();
205 for(;;) { 208 for(;;) {
  209 +#if defined(ESP8266)
  210 + yield();
  211 +#endif
206 if(millis() - startMillis >= _timeoutMs) { 212 if(millis() - startMillis >= _timeoutMs) {
207 _lastError = ERROR_CODES::RECEIVE_TIMEOUT; 213 _lastError = ERROR_CODES::RECEIVE_TIMEOUT;
208 _OTP->reset(); 214 _OTP->reset();