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.
Dependents: DigitalCamera_OV5642_WIZwiki-W7500 BMC F746NG_TestAll Prelude_OV5642_dev
Diff: millis.cpp
- Revision:
- 0:571ea8a1bbae
- Child:
- 1:d1b960698e70
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/millis.cpp Mon Nov 24 17:02:21 2014 +0000
@@ -0,0 +1,25 @@
+// millis as in Arduino...
+
+#include "mbed.h"
+#include "millis.h"
+
+static volatile uint32_t MilliSeconds_u32;
+
+static Ticker MilliSecondsTicker;
+
+static void MilliSecondsTickerIRQ()
+{
+ MilliSeconds_u32 ++;
+}
+
+uint32_t millis ()
+{
+ return MilliSeconds_u32;
+}
+
+void StartMillis ()
+{
+ MilliSecondsTicker.attach_us (&MilliSecondsTickerIRQ, 1000);
+}
+
+// End of file
\ No newline at end of file