Skip to content
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

Add RTC examples & expand RealTimeClock & ClockManager capabilities. #676

Merged
merged 6 commits into from
Nov 22, 2023

Conversation

ithinuel
Copy link
Member

No description provided.

@jannic
Copy link
Member

jannic commented Aug 29, 2023

I like those examples. Properly configuring the dormant state is non-trivial, so having a working example is really useful.

Perhaps you could add a comment with the results of the measurements you mentioned in #659 (comment) ?

Comment on lines -32 to -33
#[cfg_attr(feature = "chrono", path = "datetime_chrono.rs")]
#[cfg_attr(not(feature = "chrono"), path = "datetime_no_deps.rs")]
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change and should be kept separate from this PR.

I don't know the full implications of this change. The conditional compilation was introduced by #213. @VictorKoenders and @9names did work on that PR. Can you comment on whether this conditional chrono support has proven useful in the mean time?

Copy link
Member Author

Choose a reason for hiding this comment

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

For the motivation of that change in this PR, this feature currently changes the shape of the API.

This makes the rtc examples require conditional compilation to accommodate with the different DateTime creation style.

Following the philosophy of features being additive, it seems more natural that enabling the chrono feature adds chrono support rather than replace the local types.

Copy link
Member

Choose a reason for hiding this comment

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

That's a very good point for making the no-deps implementation available unconditionally. But in it's current form, this PR completely removes chrono support. (It leaves the datetime_chrono.rs file in place, but there's no longer any code referencing it.)

Copy link
Member Author

Choose a reason for hiding this comment

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

This block should be enough to allow easy conversion between chrono's NaiveDateTime and our own DateTime type.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jonathanpallant recommended using chrono in the previous PR #207, which is why it was in #213

@jannic jannic added the breaking change This pull request contains a SemVer breaking change label Oct 22, 2023
@jannic jannic added this to the 0.10.0 milestone Oct 22, 2023
@ithinuel
Copy link
Member Author

@jonathanpallant do you think the approach proposed here is acceptable?

@ithinuel ithinuel merged commit 41b3e41 into rp-rs:main Nov 22, 2023
8 checks passed
@ithinuel ithinuel deleted the enable-rtc-irq branch November 22, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This pull request contains a SemVer breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants