aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/Arduino.h
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-12-31 11:21:44 -0500
committerZach Eveland <zeveland@blacklabel-development.com>2011-12-31 11:21:44 -0500
commitcbce8ed4bf330973a999220dd11444b6d1181d53 (patch)
treee0e56d3e8a6cf6b12fdde5e511d61de3375b8095 /cores/arduino/Arduino.h
parent80b02232e4b8912dbaadef47ca4cf24f35fa473d (diff)
parent3ece2827a48166d957d3e347035561d5a1104930 (diff)
Merge branch 'master' of github.com:arduino/Arduino into new-extension
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))