diff options
Diffstat (limited to 'cores/arduino/wiring.h')
-rwxr-xr-x | cores/arduino/wiring.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cores/arduino/wiring.h b/cores/arduino/wiring.h index 7245797..027a8d1 100755 --- a/cores/arduino/wiring.h +++ b/cores/arduino/wiring.h @@ -85,8 +85,8 @@ extern "C"{ #define noInterrupts() cli() #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) -#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) -#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) +#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) ) +#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L ) #define lowByte(w) ((uint8_t) ((w) & 0xff)) #define highByte(w) ((uint8_t) ((w) >> 8)) |