-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
machine.RTC.init documentation is incorrect #5733
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
I think that the documentation should be updated to reflect the code, but I thought I would raise this issue to discuss that before submitting a PR. |
See #5553 |
Just came along the same mess while implementing a machine.RTC module for mimxrt. It seem the only port using rtc.now() is the cc3200 one, which is stale. So I went for rtc.datetime(). |
This is still messed up. The Raspberry Pi Pico doesn't have a init() function, also the wday in |
You don't need |
Uh oh!
There was an error while loading. Please reload this page.
The machine.RTC documentation has some discrepancies.
The ESP8266 machine.RTC modules doesn't appear to have an init function, but rather has a datetime function.
micropython/ports/esp8266/machine_rtc.c
Line 127 in 8db5d2d
The order of the arguments to datetime appears to be (year, month, day, wday, hour, minute, seconds, milliseconds)
The ESP32 machine.RTC module
micropython/ports/esp32/machine_rtc.c
Line 87 in 8db5d2d
has an init function and a datetime function. The order of the arguments for datetime and init appears to be (year, month, day, hour, minute, seconds, microseconds)
The stm32 machine.RTC module forwards to pyb.RTC
micropython/ports/stm32/rtc.c
Line 515 in 8db5d2d
which has an init function and datetime function, but the init function doesn't take any srguments. The datetime function appears to use the order (year, month, day, wday, hour, month, seconds, microseconds)
The documentation documents an init function with arguments in a different order to any of the above and doesnt't mention a datetime function.
And the EPS8266 appears to take milliseconds as the last argument, whereas the others take microseconds.
The text was updated successfully, but these errors were encountered: