stm32/pwm: small cleanups

This commit is contained in:
Dario Nieuwenhuis 2021-11-27 03:05:10 +01:00
parent 22fad1e7bc
commit d7d1258411
2 changed files with 3 additions and 8 deletions

View file

@ -41,6 +41,7 @@ pub mod i2c;
#[cfg(crc)] #[cfg(crc)]
pub mod crc; pub mod crc;
pub mod pwm;
#[cfg(pwr)] #[cfg(pwr)]
pub mod pwr; pub mod pwr;
#[cfg(rng)] #[cfg(rng)]
@ -51,8 +52,6 @@ pub mod sdmmc;
pub mod spi; pub mod spi;
#[cfg(usart)] #[cfg(usart)]
pub mod usart; pub mod usart;
//#[cfg(pwm)]
pub mod pwm;
#[cfg(feature = "subghz")] #[cfg(feature = "subghz")]
pub mod subghz; pub mod subghz;

View file

@ -87,15 +87,11 @@ impl<'d, T: Instance> Pwm<'d, T> {
} }
pub fn enable(&mut self, channel: Channel) { pub fn enable(&mut self, channel: Channel) {
unsafe { unsafe { self.set_enable(channel, true) }
self.set_enable(channel, true);
}
} }
pub fn disable(&mut self, channel: Channel) { pub fn disable(&mut self, channel: Channel) {
unsafe { unsafe { self.set_enable(channel, false) }
self.set_enable(channel, false);
}
} }
pub fn set_freq<F: Into<Hertz>>(&mut self, freq: F) { pub fn set_freq<F: Into<Hertz>>(&mut self, freq: F) {