aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/Arduino.h
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2011-12-31 17:29:36 +0100
committerCristian Maglie <c.maglie@bug.st>2011-12-31 17:29:36 +0100
commitd32d4018b910361aa1436f297b4c9b145404bd80 (patch)
tree39612dfc77d2a2a25f78773fee60f1c7bf746a69 /cores/arduino/Arduino.h
parent806cea311e6a420d97e1b347c7d550d33f10be79 (diff)
parent3ece2827a48166d957d3e347035561d5a1104930 (diff)
Merge remote-tracking branch 'arduino/master' into platforms-b
Diffstat (limited to 'cores/arduino/Arduino.h')
-rwxr-xr-xcores/arduino/Arduino.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h
index c05b919..bfec943 100755
--- a/cores/arduino/Arduino.h
+++ b/cores/arduino/Arduino.h
@@ -73,8 +73,8 @@ extern "C"{
#define noInterrupts() cli()
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
-#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
-#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
+#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
+#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))