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: UARTserial_mio/UARTSerial_mio.cpp
- Revision:
- 12:b423b3cbec47
- Parent:
- 11:04d8899b5d82
--- a/UARTserial_mio/UARTSerial_mio.cpp Wed Nov 06 10:57:21 2019 +0000
+++ b/UARTserial_mio/UARTSerial_mio.cpp Tue Sep 14 11:15:45 2021 +0000
@@ -257,7 +257,7 @@
api_lock();
- while (_rxbuf.size()!=length) {
+ while (_rxbuf.size()!=length && tm<=timeout) {
if (!_blocking) {
api_unlock();
return -EAGAIN;
@@ -270,10 +270,11 @@
}
//printf("tm: %f\r\n",tm);
-
- while (data_read < length && !_rxbuf.empty()) {
+ tm = 0.0;
+ while (data_read < length && !_rxbuf.empty() && tm<=timeout) {
_rxbuf.pop(*ptr++);
data_read++;
+ tm = tm + 0.001; //10/1000
}
core_util_critical_section_enter();