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: SerialCtrl.cpp
- Revision:
- 6:9f5a9b099342
- Parent:
- 5:731e4a7f5947
- Child:
- 7:a5334d446b0d
--- a/SerialCtrl.cpp Thu Apr 08 11:10:03 2021 +0000
+++ b/SerialCtrl.cpp Fri Apr 09 07:23:16 2021 +0000
@@ -50,10 +50,12 @@
}
unsigned char SerialCtrl::input() {
+ unsigned char temp;
+
_Timer->reset();
- while(_Timer->read_ms() < TIMEOUT_MS) {
+ while(duration_cast<std::chrono::milliseconds>(_Timer->elapsed_time()).count() < TIMEOUT_MS) {
if( _Serial->readable() ) {
- return _Serial->getc();
+ return _Serial->read(&temp, 1);
}
}
return NUL;