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.
Fork of mbed-dev by
Diff: drivers/UARTSerial.cpp
- Revision:
- 176:447f873cad2f
- Parent:
- 170:19eb464bc2be
--- a/drivers/UARTSerial.cpp Wed Oct 11 12:45:49 2017 +0100
+++ b/drivers/UARTSerial.cpp Wed Oct 25 14:53:38 2017 +0100
@@ -19,7 +19,12 @@
#include <errno.h>
#include "UARTSerial.h"
#include "platform/mbed_poll.h"
+
+#if MBED_CONF_RTOS_PRESENT
+#include "rtos/Thread.h"
+#else
#include "platform/mbed_wait_api.h"
+#endif
namespace mbed {
@@ -277,6 +282,17 @@
}
}
+void UARTSerial::wait_ms(uint32_t millisec)
+{
+ /* wait_ms implementation for RTOS spins until exact microseconds - we
+ * want to just sleep until next tick.
+ */
+#if MBED_CONF_RTOS_PRESENT
+ rtos::Thread::wait(millisec);
+#else
+ ::wait_ms(millisec);
+#endif
+}
} //namespace mbed
#endif //(DEVICE_SERIAL && DEVICE_INTERRUPTIN)
