From 80cf383855f89d639068d2cd2f60d37ca276455a Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 8 Oct 2005 08:46:13 +0000 Subject: [PATCH] millis() now returns a new value every millisecond, instead of every second. --- targets/arduino/wiring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/arduino/wiring.c b/targets/arduino/wiring.c index 98ed9a330..d5d18a63f 100755 --- a/targets/arduino/wiring.c +++ b/targets/arduino/wiring.c @@ -277,7 +277,7 @@ unsigned long millis() // overflows when it reaches 256. we calculate the total // number of clock cycles, then divide by the number of clock // cycles per millisecond. - return timer0GetOverflowCount() * timer0GetPrescaler() * 256L / F_CPU * 1000L; + return timer0GetOverflowCount() * timer0GetPrescaler() * 256L / (F_CPU / 1000L); } void delay(unsigned long ms)