Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cores/esp8266/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ int Stream::timedRead() {
c = read();
if(c >= 0)
return c;
if(_timeout == 0)
return -1;
yield();
} while(millis() - _startMillis < _timeout);
return -1; // -1 indicates timeout
Expand All @@ -46,6 +48,8 @@ int Stream::timedPeek() {
c = peek();
if(c >= 0)
return c;
if(_timeout == 0)
return -1;
yield();
} while(millis() - _startMillis < _timeout);
return -1; // -1 indicates timeout
Expand Down Expand Up @@ -254,4 +258,3 @@ String Stream::readStringUntil(char terminator) {
}
return ret;
}