Skip to content

Commit

Permalink
Remove unnecessary generic from ChannelHW (#2387)
Browse files Browse the repository at this point in the history
* Remove unnecessary generic from ChannelHW

* Changelog
  • Loading branch information
bugadani authored Oct 22, 2024
1 parent 54d4407 commit 1afc9ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

- The `i2s::{I2sWrite, I2sWriteDma, I2sRead, I2sReadDma, I2sWriteDmaAsync, I2sReadDmaAsync}` traits have been removed. (#2316)
- The `ledc::ChannelHW` trait is no longer generic. (#2387)

## [0.21.1]

Expand Down
10 changes: 5 additions & 5 deletions esp-hal/src/ledc/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub mod config {
/// Channel interface
pub trait ChannelIFace<'a, S: TimerSpeed + 'a, O: PeripheralOutput + 'a>
where
Channel<'a, S, O>: ChannelHW<O>,
Channel<'a, S, O>: ChannelHW,
{
/// Configure channel
fn configure(&mut self, config: config::Config<'a, S>) -> Result<(), Error>;
Expand All @@ -118,7 +118,7 @@ where
}

/// Channel HW interface
pub trait ChannelHW<O: PeripheralOutput> {
pub trait ChannelHW {
/// Configure Channel HW except for the duty which is set via
/// [`Self::set_duty_hw`].
fn configure_hw(&mut self) -> Result<(), Error>;
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<'a, S: TimerSpeed, O: PeripheralOutput> Channel<'a, S, O> {

impl<'a, S: TimerSpeed, O: PeripheralOutput> ChannelIFace<'a, S, O> for Channel<'a, S, O>
where
Channel<'a, S, O>: ChannelHW<O>,
Channel<'a, S, O>: ChannelHW,
{
/// Configure channel
fn configure(&mut self, config: config::Config<'a, S>) -> Result<(), Error> {
Expand Down Expand Up @@ -312,7 +312,7 @@ mod ehal1 {

impl<'a, S: TimerSpeed, O: OutputPin> SetDutyCycle for Channel<'a, S, O>
where
Channel<'a, S, O>: ChannelHW<O>,
Channel<'a, S, O>: ChannelHW,
{
fn max_duty_cycle(&self) -> u16 {
let duty_exp;
Expand Down Expand Up @@ -535,7 +535,7 @@ impl<'a, O: PeripheralOutput, S: crate::ledc::timer::TimerSpeed> Channel<'a, S,
}
}

impl<'a, O, S> ChannelHW<O> for Channel<'a, S, O>
impl<'a, O, S> ChannelHW for Channel<'a, S, O>
where
O: PeripheralOutput,
S: crate::ledc::timer::TimerSpeed,
Expand Down

0 comments on commit 1afc9ee

Please sign in to comment.