Skip to content

Commit b36fbfb

Browse files
facchinmsoburi
authored andcommitted
core: add time related macros
Fixes compilation error found at https://www.cnx-software.com/2024/12/10/arduino-core-for-zephyr-beta-released/ Co-Authored-by: Martino Facchin <m.facchin@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent 5d8b496 commit b36fbfb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/arduino/time_macros.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)