We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents be996ab + b48aa8c commit 05870d9Copy full SHA for 05870d9
hardware/arduino/avr/cores/arduino/Arduino.h
@@ -73,8 +73,8 @@ extern "C"{
73
#define noInterrupts() cli()
74
75
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
76
-#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
77
-#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
+#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
+#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
78
79
#define lowByte(w) ((uint8_t) ((w) & 0xff))
80
#define highByte(w) ((uint8_t) ((w) >> 8))
0 commit comments