Improve operation on ESP32 and ESP8266 (add TINY_GSM_YIELD where needed)
This commit is contained in:
@@ -470,7 +470,7 @@ private:
|
|||||||
|
|
||||||
bool streamSkipUntil(char c) { //TODO: timeout
|
bool streamSkipUntil(char c) { //TODO: timeout
|
||||||
while (true) {
|
while (true) {
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
if (stream.read() == c)
|
if (stream.read() == c)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -529,7 +529,7 @@ private:
|
|||||||
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
||||||
}
|
}
|
||||||
while (len--) {
|
while (len--) {
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
sockets[mux]->rx.put(stream.read());
|
sockets[mux]->rx.put(stream.read());
|
||||||
}
|
}
|
||||||
data = "";
|
data = "";
|
||||||
|
@@ -328,7 +328,7 @@ private:
|
|||||||
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
||||||
}
|
}
|
||||||
while (len--) {
|
while (len--) {
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
sockets[mux]->rx.put(stream.read());
|
sockets[mux]->rx.put(stream.read());
|
||||||
}
|
}
|
||||||
data = "";
|
data = "";
|
||||||
|
@@ -491,7 +491,7 @@ private:
|
|||||||
|
|
||||||
bool streamSkipUntil(char c) { //TODO: timeout
|
bool streamSkipUntil(char c) { //TODO: timeout
|
||||||
while (true) {
|
while (true) {
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
if (stream.read() == c)
|
if (stream.read() == c)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -550,7 +550,7 @@ private:
|
|||||||
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
||||||
}
|
}
|
||||||
while (len--) {
|
while (len--) {
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
sockets[mux]->rx.put(stream.read());
|
sockets[mux]->rx.put(stream.read());
|
||||||
}
|
}
|
||||||
data = "";
|
data = "";
|
||||||
|
@@ -568,13 +568,13 @@ private:
|
|||||||
|
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
#ifdef TINY_GSM_USE_HEX
|
#ifdef TINY_GSM_USE_HEX
|
||||||
while (stream.available() < 2) {}
|
while (stream.available() < 2) { TINY_GSM_YIELD(); }
|
||||||
char buf[4] = { 0, };
|
char buf[4] = { 0, };
|
||||||
buf[0] = stream.read();
|
buf[0] = stream.read();
|
||||||
buf[1] = stream.read();
|
buf[1] = stream.read();
|
||||||
char c = strtol(buf, NULL, 16);
|
char c = strtol(buf, NULL, 16);
|
||||||
#else
|
#else
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
char c = stream.read();
|
char c = stream.read();
|
||||||
#endif
|
#endif
|
||||||
sockets[mux]->rx.put(c);
|
sockets[mux]->rx.put(c);
|
||||||
@@ -621,7 +621,7 @@ private:
|
|||||||
|
|
||||||
bool streamSkipUntil(char c) { //TODO: timeout
|
bool streamSkipUntil(char c) { //TODO: timeout
|
||||||
while (true) {
|
while (true) {
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||||
if (stream.read() == c)
|
if (stream.read() == c)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user