We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0c78c6b + f2801f1 commit 5a2af3dCopy full SHA for 5a2af3d
cores/arduino/Arduino.h
@@ -113,6 +113,7 @@ int digitalPinToInterrupt(pin_size_t pin);
113
#include <zephyrSerial.h>
114
#include <strings.h>
115
#include <api/itoa.h>
116
+#include <time_macros.h>
117
118
// Allow namespace-less operations if Arduino.h is included
119
using namespace arduino;
cores/arduino/time_macros.h
@@ -0,0 +1,7 @@
1
+#pragma once
2
+
3
+#include <zephyr/sys/time_units.h>
4
5
+#define clockCyclesPerMicrosecond() (1000000 / k_cyc_to_ns_near64(1000))
6
+#define clockCyclesToMicroseconds(a) (a / clockCyclesPerMicrosecond())
7
+#define microsecondsToClockCycles(a) (a * clockCyclesPerMicrosecond())
0 commit comments