Skip to content

Commit 4e66b69

Browse files
committed
Fixed download issue that Terminus made happen more frequently
1 parent bdbdd7e commit 4e66b69

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/bl.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,9 @@ static https_request_err_e downloadAndShow()
848848

849849
buffer = (uint8_t *)malloc(counter);
850850
if (buffer) {
851-
while (iCount < counter && millis() < (lStartTime + API_FIRST_RETRY*1000) && stream->connected()) {
852-
iLen = stream->available();
853-
if (iLen) {
854-
stream->readBytes(&buffer[iCount], iLen);
855-
iCount += iLen;
851+
while (iCount < counter && millis() < (lStartTime + API_FIRST_RETRY*1000)) {
852+
if (stream->available()) {
853+
buffer[iCount++] = stream->read();
856854
} else {
857855
vTaskDelay(1); // yield to allow time for the data to arrive
858856
}

0 commit comments

Comments
 (0)