From 1afc9eef8912aab33c285aa6fcdbf5695accb6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Tue, 22 Oct 2024 17:41:42 +0200 Subject: [PATCH] Remove unnecessary generic from ChannelHW (#2387) * Remove unnecessary generic from ChannelHW * Changelog --- esp-hal/CHANGELOG.md | 1 + esp-hal/src/ledc/channel.rs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index ff30e2da313..813893cb19e 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -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] diff --git a/esp-hal/src/ledc/channel.rs b/esp-hal/src/ledc/channel.rs index dd3bd18cd24..2d7feacd00a 100644 --- a/esp-hal/src/ledc/channel.rs +++ b/esp-hal/src/ledc/channel.rs @@ -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, + Channel<'a, S, O>: ChannelHW, { /// Configure channel fn configure(&mut self, config: config::Config<'a, S>) -> Result<(), Error>; @@ -118,7 +118,7 @@ where } /// Channel HW interface -pub trait ChannelHW { +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>; @@ -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, + Channel<'a, S, O>: ChannelHW, { /// Configure channel fn configure(&mut self, config: config::Config<'a, S>) -> Result<(), Error> { @@ -312,7 +312,7 @@ mod ehal1 { impl<'a, S: TimerSpeed, O: OutputPin> SetDutyCycle for Channel<'a, S, O> where - Channel<'a, S, O>: ChannelHW, + Channel<'a, S, O>: ChannelHW, { fn max_duty_cycle(&self) -> u16 { let duty_exp; @@ -535,7 +535,7 @@ impl<'a, O: PeripheralOutput, S: crate::ledc::timer::TimerSpeed> Channel<'a, S, } } -impl<'a, O, S> ChannelHW for Channel<'a, S, O> +impl<'a, O, S> ChannelHW for Channel<'a, S, O> where O: PeripheralOutput, S: crate::ledc::timer::TimerSpeed,