aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf
diff options
context:
space:
mode:
authorGiona Imperatori <[email protected]>2024-07-01 18:06:14 +0200
committerGiona Imperatori <[email protected]>2024-07-01 18:06:14 +0200
commitf418006508380fa40058b896a753cdafbf9bdc86 (patch)
treebf1f4cb7f51651c6f14d4c8a92fd6cc0d6668919 /embassy-nrf
parent7884babb9d1557549e5732d6ab42a4f4c28f25e7 (diff)
fixup! feat(pwm): allow specifying OutputDrive for PWM channels
Diffstat (limited to 'embassy-nrf')
-rw-r--r--embassy-nrf/src/pwm.rs8
1 files 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> {
836 #[inline(always)] 836 #[inline(always)]
837 pub fn set_ch0_drive(&self, drive: OutputDrive) { 837 pub fn set_ch0_drive(&self, drive: OutputDrive) {
838 if let Some(pin) = &self.ch0 { 838 if let Some(pin) = &self.ch0 {
839 pin.conf().write(|w| w.drive().variant(convert_drive(drive))); 839 pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive)));
840 } 840 }
841 } 841 }
842 842
@@ -844,7 +844,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> {
844 #[inline(always)] 844 #[inline(always)]
845 pub fn set_ch1_drive(&self, drive: OutputDrive) { 845 pub fn set_ch1_drive(&self, drive: OutputDrive) {
846 if let Some(pin) = &self.ch1 { 846 if let Some(pin) = &self.ch1 {
847 pin.conf().write(|w| w.drive().variant(convert_drive(drive))); 847 pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive)));
848 } 848 }
849 } 849 }
850 850
@@ -852,7 +852,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> {
852 #[inline(always)] 852 #[inline(always)]
853 pub fn set_ch2_drive(&self, drive: OutputDrive) { 853 pub fn set_ch2_drive(&self, drive: OutputDrive) {
854 if let Some(pin) = &self.ch2 { 854 if let Some(pin) = &self.ch2 {
855 pin.conf().write(|w| w.drive().variant(convert_drive(drive))); 855 pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive)));
856 } 856 }
857 } 857 }
858 858
@@ -860,7 +860,7 @@ impl<'d, T: Instance> SimplePwm<'d, T> {
860 #[inline(always)] 860 #[inline(always)]
861 pub fn set_ch3_drive(&self, drive: OutputDrive) { 861 pub fn set_ch3_drive(&self, drive: OutputDrive) {
862 if let Some(pin) = &self.ch3 { 862 if let Some(pin) = &self.ch3 {
863 pin.conf().write(|w| w.drive().variant(convert_drive(drive))); 863 pin.conf().modify(|_, w| w.drive().variant(convert_drive(drive)));
864 } 864 }
865 } 865 }
866} 866}