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

[DMA 1/N] Add mode to DMA channel drivers #2519

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Nov 12, 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 📖

Description

This PR adds Mode type parameters to ChannelRx and ChannelTx, so that in the future we can independently configure them between blocking and async modes. The PR also swaps the Mode and DMA chanel type params of Channel, so that it is consistent with other peripherals - even if we apply different rules to DMA instance typing.

@bugadani bugadani force-pushed the dma-mode branch 7 times, most recently from 5b89010 to b901bd6 Compare November 12, 2024 14:19
@bugadani bugadani marked this pull request as ready for review November 12, 2024 14:36
@bugadani bugadani marked this pull request as draft November 12, 2024 15:19
@bugadani

This comment was marked as outdated.

@bugadani bugadani changed the title Add mode to DMA channel drivers [DMA 1/N] Add mode to DMA channel drivers Nov 13, 2024
@bugadani bugadani marked this pull request as ready for review November 13, 2024 18:01
@bugadani bugadani force-pushed the dma-mode branch 2 times, most recently from 45b74c8 to 1990754 Compare November 13, 2024 20:46
Copy link
Collaborator

@Dominaezzz Dominaezzz left a comment

Choose a reason for hiding this comment

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

Besides the burst thing, it looks like the behavior is overall the same.

esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
Comment on lines +2228 to +2229
fn peripheral_interrupt(&self) -> Option<Interrupt>;
fn async_handler(&self) -> Option<InterruptHandler>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Long term I think these should be #[cfg]s rather than Options, as it makes it easier to grok what's really happening.

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.

LGTM

@bugadani bugadani added this pull request to the merge queue Nov 14, 2024
Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Merged via the queue into esp-rs:main with commit 38dde2e Nov 14, 2024
28 checks passed
@bugadani bugadani deleted the dma-mode branch November 14, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants