Skip to content

Fix timewrap bug#1972

Open
weebl2000 wants to merge 4 commits intomeshcore-dev:devfrom
weebl2000:fix-timewrap-comparison
Open

Fix timewrap bug#1972
weebl2000 wants to merge 4 commits intomeshcore-dev:devfrom
weebl2000:fix-timewrap-comparison

Conversation

@weebl2000
Copy link
Contributor

I don't think this one would actually occur in the field. But @ripplebiz managed to point me in the right direction by setting clock 5 mins prior to the 49 day wraparound.

First half of the 49 day wrap period the check works, but the second half it didn't because of the wraparound bug.

Good to have it fixed for any future changes that might impact it.

@JDat
Copy link

JDat commented Mar 9, 2026

Looks OKayish! Need to add documentation so everyone, who is adding/writing Meshcore code can easy find function named millis_passed() without looking/listing tons of headers.

@weebl2000 weebl2000 force-pushed the fix-timewrap-comparison branch from 3a50df3 to 79578fb Compare March 9, 2026 13:51
@weebl2000
Copy link
Contributor Author

Looks OKayish! Need to add documentation so everyone, who is adding/writing Meshcore code can easy find function named millis_passed() without looking/listing tons of headers.

Added a doxygen comment, do we want docs in more places?

@JDat
Copy link

JDat commented Mar 9, 2026

Is doxygen documentation generated automatically? That would be nice.

Btw, problem, theory and fix on millis() 49 day rollover problem is here.

https://www.norwegiancreations.com/2018/10/arduino-tutorial-avoiding-the-overflow-issue-when-using-millis-and-micros/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants