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

[2/3] Timer refactor: TIMG #2581

Merged
merged 13 commits into from
Nov 22, 2024
Merged

[2/3] Timer refactor: TIMG #2581

merged 13 commits into from
Nov 22, 2024

Conversation

MabezDev
Copy link
Member

@MabezDev MabezDev commented Nov 21, 2024

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 📖

Description

Part 2 which simplifies the TIMG timers. All sub timers now have the same type erased type: Timer. I also managed to dedupe and remove the instance trait completely (the instance trait for TIMG still exists), which is a huge code saving.

@MabezDev MabezDev force-pushed the dumb-timer/timg branch 3 times, most recently from b1f3c0a to fa2cb18 Compare November 22, 2024 11:10
@MabezDev MabezDev marked this pull request as ready for review November 22, 2024 11:10
@MabezDev MabezDev added the skip-changelog No changelog modification needed label Nov 22, 2024
@MabezDev
Copy link
Member Author

Skip changelog for the same reasons as part 1

esp-hal/src/timer/timg.rs Show resolved Hide resolved
esp-hal/src/timer/timg.rs Outdated Show resolved Hide resolved
@MabezDev MabezDev changed the title [2/4] Timer refactor: TIMG [2/3] Timer refactor: TIMG Nov 22, 2024
* Removes _all_ type params on Alarm
* Systimer no longer implements peripheral ref, the peripheral ref
  pattern is instead intended to be used on the higher level timer
  drivers
* Removed `Unit` as a type, in favour of an enum
* Alarms are back in the main `SystemTimer` "driver"
* Made all `Unit` modification methods unsafe, it's not possible to
  modify the `Unit`'s safely whilst timers and or the `time::now` API is
  in use
* Removes _all_ type params on Alarm
* Systimer no longer implements peripheral ref, the peripheral ref
  pattern is instead intended to be used on the higher level timer
  drivers
* Removed `Unit` as a type, in favour of an enum
* Alarms are back in the main `SystemTimer` "driver"
* Made all `Unit` modification methods unsafe, it's not possible to
  modify the `Unit`'s safely whilst timers and or the `time::now` API is
  in use
@MabezDev MabezDev force-pushed the dumb-timer/timg branch 2 times, most recently from e8833cd to 8ec33b5 Compare November 22, 2024 12:21
- `SystemTimer::set_unit_value` & `SystemTimer::configure_unit` (#2576)

### Changed
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 looks wonky because it's wonky in main: https://github.com/esp-rs/esp-hal/blob/main/esp-hal/CHANGELOG.md

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@playfulFence playfulFence left a comment

Choose a reason for hiding this comment

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

Thanks for making things more convenient and simple! Just one question here...

esp-hal/src/timer/timg.rs Outdated Show resolved Hide resolved
@MabezDev MabezDev added this pull request to the merge queue Nov 22, 2024
Merged via the queue into esp-rs:main with commit 79ca9d0 Nov 22, 2024
28 checks passed
@MabezDev MabezDev deleted the dumb-timer/timg branch November 22, 2024 19:30
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.

5 participants