millis() now returns a new value every millisecond, instead of every second.

This commit is contained in:
David A. Mellis 2005-10-08 08:46:13 +00:00
parent a0ae74b1ff
commit 80cf383855
1 changed files with 1 additions and 1 deletions

View File

@ -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)