Skip to content

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

Closed
peterhinch wants to merge 1 commit into
micropython:masterfrom
peterhinch:machine-rtc-doc
Closed

peterhinch wants to merge 1 commit into
micropython:masterfrom
peterhinch:machine-rtc-doc

Conversation

@peterhinch

Copy link
Copy Markdown
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

tve commented Jan 21, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

This continues to cause problems in the forum.

@kadamski kadamski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@astrorafael

Copy link
Copy Markdown

+1

@dpgeorge

Copy link
Copy Markdown
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