Skip to content

Range of mills() on ATTiny1616? #1072

Discussion options

You must be logged in to vote

Strictly speaking, it's a warning, not an error, but the root cause is that it's treating the "60" and "1000" as ints (16-bit signed) and deciding that there's a risk of overflow. I'm not guru enough to know if the code it generates is correct.

There's a voice inside me that's paranoid about order of operations (and readability to some extent), so I'd pretty much always do "millisNow + ( 60 * 1000L)" :-)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JeremyLaurenson
Comment options

Answer selected by JeremyLaurenson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants