Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ int digitalPinToInterrupt(pin_size_t pin);
#include <zephyrSerial.h>
#include <strings.h>
#include <api/itoa.h>
#include <time_macros.h>

// Allow namespace-less operations if Arduino.h is included
using namespace arduino;
Expand Down
7 changes: 7 additions & 0 deletions cores/arduino/time_macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include <zephyr/sys/time_units.h>

#define clockCyclesPerMicrosecond() (1000000 / k_cyc_to_ns_near64(1000))
#define clockCyclesToMicroseconds(a) (a / clockCyclesPerMicrosecond())
#define microsecondsToClockCycles(a) (a * clockCyclesPerMicrosecond())
Loading