Frank 7 年前
父节点
当前提交
b51a304afb
共有 1 个文件被更改,包括 4 次插入28 次删除
  1. +4
    -28
      teensy3/Stream.cpp

+ 4
- 28
teensy3/Stream.cpp 查看文件

@@ -256,7 +256,7 @@ size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length)
String Stream::readString(size_t max)
{
String str;
size_t length = str.length();
size_t length = 0;
while (length < max) {
int c = timedRead();
if (c < 0) {
@@ -265,6 +265,7 @@ String Stream::readString(size_t max)
}
if (c == 0) break;
str += (char)c;
length++;
}
return str;
}
@@ -272,7 +273,7 @@ String Stream::readString(size_t max)
String Stream::readStringUntil(char terminator, size_t max)
{
String str;
size_t length = str.length();
size_t length = 0;
while (length < max) {
int c = timedRead();
if (c < 0) {
@@ -281,32 +282,7 @@ String Stream::readStringUntil(char terminator, size_t max)
}
if (c == 0 || c == terminator) break;
str += (char)c;
length++;
}
return str;
}



























正在加载...
取消
保存