From f418006508380fa40058b896a753cdafbf9bdc86 Mon Sep 17 00:00:00 2001 From: Giona Imperatori Date: Mon, 1 Jul 2024 18:06:14 +0200 Subject: [PATCH] fixup! feat(pwm): allow specifying OutputDrive for PWM channels --- embassy-nrf/src/pwm.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index a2853de3f..8e8f166d7 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs @@ -836,7 +836,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> { #[inline(always)] pub fn set_ch0_drive(&self, drive: OutputDrive) { if let Some(pin) = &self.ch0 { - pin.conf().write(|w| w.drive().variant(convert_drive(drive))); + pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive))); } } @@ -844,7 +844,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> { #[inline(always)] pub fn set_ch1_drive(&self, drive: OutputDrive) { if let Some(pin) = &self.ch1 { - pin.conf().write(|w| w.drive().variant(convert_drive(drive))); + pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive))); } } @@ -852,7 +852,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> { #[inline(always)] pub fn set_ch2_drive(&self, drive: OutputDrive) { if let Some(pin) = &self.ch2 { - pin.conf().write(|w| w.drive().variant(convert_drive(drive))); + pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive))); } } @@ -860,7 +860,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> { #[inline(always)] pub fn set_ch3_drive(&self, drive: OutputDrive) { if let Some(pin) = &self.ch3 { - pin.conf().write(|w| w.drive().variant(convert_drive(drive))); + pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive))); } } }