mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
millis() now returns a new value every millisecond, instead of every second.
This commit is contained in:
parent
a0ae74b1ff
commit
80cf383855
@ -277,7 +277,7 @@ unsigned long millis()
|
|||||||
// overflows when it reaches 256. we calculate the total
|
// overflows when it reaches 256. we calculate the total
|
||||||
// number of clock cycles, then divide by the number of clock
|
// number of clock cycles, then divide by the number of clock
|
||||||
// cycles per millisecond.
|
// cycles per millisecond.
|
||||||
return timer0GetOverflowCount() * timer0GetPrescaler() * 256L / F_CPU * 1000L;
|
return timer0GetOverflowCount() * timer0GetPrescaler() * 256L / (F_CPU / 1000L);
|
||||||
}
|
}
|
||||||
|
|
||||||
void delay(unsigned long ms)
|
void delay(unsigned long ms)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user