Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: BufferSerial.cpp
- Revision:
- 2:304d0e762287
- Parent:
- 1:476b874003d8
--- a/BufferSerial.cpp Mon Nov 16 08:33:33 2020 +0000
+++ b/BufferSerial.cpp Wed Dec 02 08:08:12 2020 +0000
@@ -29,12 +29,14 @@
}
}
-size_t BufferSerial::readBytesUntil(char charactor,char *buffer,int length)
+size_t BufferSerial::readBytesUntil(char charactor,char* buffer,int length)
{
size_t index = 0;
while (index < length) {
int c = timedRead();
- if (c < 0 || c == charactor) break;
+ if (c < 0 || c == charactor){
+ break;
+ }
*buffer++ = (char)c;
index++;
}
@@ -63,4 +65,4 @@
if (c >= 0) return c;
} while(timer.read_ms() - _startMillis < _timeout);
return -1; // -1 indicates timeout
-}
\ No newline at end of file
+}