-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a 64bit version of the millis() function #262
base: main
Are you sure you want to change the base?
Conversation
Fixes #261 |
Looks like the commit removed code related to syslog port. Was that intentional? |
Nope. Something must not have merged properly. I'll rebase and update. |
@dkerr64 good catch. fixed now. that was strange. its like part of a single commit was missing from my branch. rebased again and now I think it looks right. |
out of curiosity, what "interesting bugs" did a 59day rollover create? thanks |
In particular I saw my device go into recovery mode when I clicked the wall button. We have a timeout value that should have reset but the millis rolled and the timeout ended up being way off in the future |
Thanks, looks good now. |
@jgstroud I added this for the ratgdo32 version, you can see the commit here. There were quite a few |
I'll take a look but I made sure it compiled without warning. I would have expected type mismatch warnings. |
I googled and apparently it is a feature of the C compilers to accept assignment to different types, and it will truncate if necessary. You can have it warn with a |
millis() will rollover after 50 days leading to some interesting bugs. Create a 64bit version. Signed-off-by: jgstroud <[email protected]>
Yeah, it's definitely legal in C. I really thought it would throw a warning if you didnt explicitly cast the data type, but I think I'm wrong there. I also forgot that a long is 32 bits on this device. Pushed new code that hopefully catches the rest of the missed variables |
Yes, I think you got them all now. Thanks. |
Spoke too soon. I found another one... |
I had 2 crashes after 10 days. I haven't analyzed the crash dumps yet to see if it is related to this patch, but leading up to that I had a storm of HK log messages asking for the firmware version. hundreds per second. so maybe unrelated. |
I thought I got that one 🤔 |
@dkerr64 pretty sure this change has introduced some instabilities. It needs some rethinking before merging. |
ok, that is concerning. I would not have expected a change from storing a value as 32bit to storing at 64bit to make any difference. |
There are only a few places where I think the rollover isn't handled properly. So, I think I'll fix that and keep with the 32bit version. I think we should only use the 64bit for the uptime. The ESP32 probably better handles 64bit. But if you are seeing crashes, I wouldn't rule this out. |
millis() will rollover after 50 days leading to some interesting bugs. Create a 64bit version.