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

Flatten Uart module, remove unnecessary data, replace methods with apply_config #2449

Merged
merged 10 commits into from
Nov 5, 2024

Conversation

bugadani
Copy link
Contributor

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

The main goal of this PR is to implement apply_config. This requires removing some internally tracked state, and moving some code around. cc #2416 and #1919

Some of the previous change methods weren't even public.

I'm also proposing flattening the module (i.e. removing config). When using multiple configurable peripherals, it's much neater to refer to the config struct as uart::Config than uart::config::Config. cc #2010

I'm also implementing embassy_embedded_hal::SetConfig because why not (and we'll want to implement it for Spi anyway, so the dependency will be used even if it's not terribly useful for UART).

@bugadani bugadani changed the title Flatten Uart module, remove unnecessary data Flatten Uart module, remove unnecessary data, replace methods with apply_config Nov 2, 2024
@bugadani bugadani marked this pull request as ready for review November 4, 2024 11:57
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.

+1 for getting rid of the config module

Copy link
Member

@SergioGasquez SergioGasquez 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

esp-hal/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Sergio Gasquez Arcos <[email protected]>
@bugadani bugadani enabled auto-merge November 5, 2024 09:39
@bugadani bugadani added this pull request to the merge queue Nov 5, 2024
Merged via the queue into esp-rs:main with commit 665fb0e Nov 5, 2024
27 of 28 checks passed
@bugadani bugadani deleted the uart-config branch November 5, 2024 10:13
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.

3 participants