diff --git a/cores/arduino/wiring_time.h b/cores/arduino/wiring_time.h index da9698b..9f1e690 100644 --- a/cores/arduino/wiring_time.h +++ b/cores/arduino/wiring_time.h @@ -24,6 +24,10 @@ extern "C" { #endif +#define clockCyclesPerMicrosecond() (F_CPU / 1000000L) +#define clockCyclesToMicroseconds(a) ((a) / clockCyclesPerMicrosecond()) +#define microsecondsToClockCycles(a) ((a) * clockCyclesPerMicrosecond()) + /** * \brief Initialize timer for creating delays *