maxrefdes117

Revision:
0:78a2573ad768
diff -r 000000000000 -r 78a2573ad768 millis.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/millis.cpp	Tue Aug 06 12:19:46 2019 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "millis.h"
+
+static volatile uint32_t millisValue = 0;
+
+static  Ticker ticker;
+
+void  millisTicker ()
+{
+    millisValue ++;
+}
+
+uint32_t  millis ()
+{
+    return millisValue;
+}
+
+void  setMillis (uint32_t theValue) {
+    millisValue = theValue;
+}
+
+void  startMillis () {
+    ticker.attach (millisTicker, 0.001);    
+}
+
+void  stopMillis () {
+    ticker.detach ();
+}
+