-
Notifications
You must be signed in to change notification settings - Fork 17
Time.h on ESP32 gives hours > 24 #277
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
Comments
Printing the milliseconds in the sketch above appears to print the correct value.
|
@urish what version of the ESP Arduino core is Wokwi using? I think the culprit might be this recent change in 3.0.0 core? esp8266/Arduino#7708. Could it be that the old version of newlib is still pulled somehow? |
Minimal repro case: https://wokwi.com/arduino/projects/321115858986336850 |
Thanks @kartben ! We're using Arduino ESP32 Core v2.0.2 (not the ESP8266 core). For reference, here's the complete list of cores we currently have on the build server:
|
Right, I'm not sure how I didn't realize I was referencing the ESP8266 core! That being said, the proiblem seems incredibly similar to what is being described here: https://forum.arduino.cc/t/ntp-server-doesnt-get-the-right-date-esp8266/938391 |
My observation so far: the issue is in |
Interestingly, the SimpleTime.ino sample from the ESP32 core crashes. (see https://wokwi.com/arduino/projects/321121796856218194)
|
Sounds like the same issue as #257. If this fixes both - great :) |
Bug found - missing edge case in the implementation of the MULSH instruction (multiplies two 32-bit signed integers and returns the high part of the 64 bit result). |
Should be fixed now :) |
Awesome! Thanks, Uri. |
Very cool, I can confirm this is fixed. Thanks! |
Hooray! |
Benjamin@Discord reported that at 2021-01-17T16:36:29 this sketch shows:
Adding 310,985 hours to 1986-07-26 gives the correct time at the moment of running that sketch.
This was double-checked in Wokwi using the 'Time' library along with
#include <TimeLib.h>
. @yepher kindly tested this on real hardware, and confirmed that the results in Wokwi differ. When they ran that sketch on real hardware their output was:I would expect the behaviour of Wokwi to match the real-world hardware's results. As @urish said in that comment thread, "My bet is that's some missing feature in the RTC".
The text was updated successfully, but these errors were encountered: