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

[1/2] Remove Async/Blocking and Periodic/Target modes from systimer and timg #2542

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MabezDev
Copy link
Member

@MabezDev MabezDev commented Nov 14, 2024

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

This PR removes much of the logic out of the lower level timers, and instead moves the logic to the OneShot and Periodic timer drivers.

cc: #2321

I will do a follow up PR which adds the mode to the timer drivers, and implement into_async and the eh traits there, as this PR got surprising large surprisingly quick.

esp-hal/src/timer/systimer.rs Outdated Show resolved Hide resolved
esp-hal/src/timer/systimer.rs Show resolved Hide resolved
@MabezDev
Copy link
Member Author

I'm going to rework the systimer a bit in this PR, it's too annoying to get CI green without it. Converting back to draft for now.

@MabezDev MabezDev marked this pull request as draft November 15, 2024 10:56
@MabezDev MabezDev force-pushed the make-timers-dumb-again branch 4 times, most recently from a331d31 to bc06681 Compare November 15, 2024 14:24
- Removes the notion of Unit being a resource, instead these are
  configured at the construction of `Systimer` (and can't be
  reconfigured after we move anything out of `Systimer`, this mimics the
  behaviour of `FrozenTimer` without having to deal with it
@MabezDev MabezDev marked this pull request as ready for review November 15, 2024 14:54
@MabezDev MabezDev changed the title Remove Async/Blocking and Periodic/Target modes from systimer and timg [1/2] Remove Async/Blocking and Periodic/Target modes from systimer and timg Nov 15, 2024
@MabezDev MabezDev added the skip-changelog No changelog modification needed label Nov 15, 2024
@MabezDev
Copy link
Member Author

skip change log for esp-wifi and esp-embassy-hal changes, they are breaking but not for anyone upgrading (esp-wifi etc are tightly coupled to esp-hal right now).

}
}
/// Alarms created from the System Timer peripheral.
pub struct SysTimerAlarms {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub struct SysTimerAlarms {
pub struct SystemTimerAlarms {

We should probably be consistent with our naming.

@MabezDev MabezDev marked this pull request as draft November 17, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants