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: Arduino-mbed-APIs/arduino-mbed.cpp
- Revision:
- 80:62f0b027efff
- Parent:
- 79:8ae448a3c1fd
- Child:
- 84:3428e25c7157
--- a/Arduino-mbed-APIs/arduino-mbed.cpp Thu Aug 03 11:59:54 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-mbed.cpp Thu Aug 03 13:43:35 2017 +0200
@@ -175,6 +175,19 @@
static void pinInt47(void) { InterruptIn::_irq_handler(intPtrTable[47].context); }
+void wait_ms(uint32_t ms)
+{
+ uint32_t start = ms_getTicker();
+
+ while (true) {
+ uint32_t t = ms_getTicker();
+ if (t < start) // warp.
+ start = 0;
+ if (t > (start + ms))
+ break;
+ }
+}
+
struct TimeoutVector TimeOuts[MAX_TIMEOUTS];
void