Skip to content

Commit 05870d9

Browse files
committed
Merge remote-tracking branch 'arduino/master' into platforms-b
2 parents be996ab + b48aa8c commit 05870d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hardware/arduino/avr/cores/arduino/Arduino.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ extern "C"{
7373
#define noInterrupts() cli()
7474

7575
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
76-
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
77-
#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
76+
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
77+
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
7878

7979
#define lowByte(w) ((uint8_t) ((w) & 0xff))
8080
#define highByte(w) ((uint8_t) ((w) >> 8))

0 commit comments

Comments
 (0)