I am using attiny microcontroller and atmel studio. And I am using the millis
function in my project.
Code related to the millis function:
And I am using this classic code:
starttimex = millis();
endtimex = starttimex;
while ((endtimex - starttimex)<=60000)
{
endtimex = millis();
// Action
}
I don't want the millis()
function to reset after 50 days.
I have to use uint64_t
instead of unsigned long
.
My questions:
Does this cause any trouble? Does this situation have a disadvantage? One of the disadvantages is memory size. I know this. But, I don't know other disadvantage.
I don't understand variable of
timer0_overflow_count
in the image. Is there a need for this formillis
?Should I do
uint64_t
for all of theunsigned long
variables in the image?
Thanks