We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a8f79c commit e7b324aCopy full SHA for e7b324a
cores/arduino/wiring.cpp
@@ -22,13 +22,15 @@
22
23
#include "wiring_private.h"
24
25
+static mbed::Timer t;
26
+
27
unsigned long millis()
28
{
- return us_ticker_read() / 1000L;
29
+ return t.read_ms();
30
}
31
32
unsigned long micros() {
- return us_ticker_read();
33
+ return t.read_us();
34
35
36
void delay(unsigned long ms)
@@ -42,7 +44,9 @@ void delayMicroseconds(unsigned int us)
42
44
43
45
46
void init()
-{}
47
+{
48
+ t.start();
49
+}
50
51
void yield() {
52
rtos::ThisThread::yield();
0 commit comments