Skip to content

Commit 31e6d9e

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 f85fee6 commit 31e6d9e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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)