test

Dependents:   Telemetria_RX_SD_GPS_copy Telemetria_RX_SD_GPS Telemetria_TX Telemetria_TX ... more

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