docs/library/machine.RTC.rst Fix example code, document datetime method. #5553
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofinit
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 thenow
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.