Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs/library/machine.RTC.rst Fix example code, document datetime method. #5553

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

Closed
wants to merge 1 commit into from

Conversation

peterhinch
Copy link
Contributor

This is the minimum change to fix the example code so it actually runs.

Unfortunately documenting the RTC class is difficult because it has been implemented differently for each platform. I checked STM, ESP8266 and ESP32. All implement datetime. Implementation of init is platform dependent: STM accepts no args. ESP8266 does not implement it while ESP32 requires a datetime tuple. Further, each platform implements a different set of methods and some documented methods are not implemented on any of these platforms: for example the now method.

Methods such as calibrate are inherently hardware dependent but where a method is implemented across platforms its calling signature should (in my view) be consistent.

There are other platforms where I don't own hardware so can't test. I'm stumped as to how properly to document this class.

@tve
Copy link
Contributor

tve commented Jan 21, 2020

Document that it's an undocumentable mess? :-)

I think the best you could do is to break it out into one section per architecture. Maybe that'll inspire someone to fix it?

@peterhinch
Copy link
Contributor Author

This continues to cause problems in the forum.

Copy link
Contributor

@kadamski kadamski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@astrorafael
Copy link

+1

@dpgeorge
Copy link
Member

Thanks for this. Merged in c0499bc

@dpgeorge dpgeorge closed this Jun 12, 2021
tannewt added a commit to tannewt/circuitpython that referenced this pull request Nov 12, 2021
Improved accuracy of common_hal_mcu_delay_us of STM port.
@peterhinch peterhinch deleted the machine-rtc-doc branch January 25, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants