aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-02-28 17:33:20 +0000
committerGitHub <[email protected]>2024-02-28 17:33:20 +0000
commit4853076ee3d30cd766581b789fe35a0e5b3ef826 (patch)
tree10e946cbdb936914adb032441b50f366bbf561a1 /examples
parentdc0fac6005eb6eb6587b9424f082b40ae6568628 (diff)
parent47c579eba2a7b4372a891bcd747f2bb0c56ce8a4 (diff)
Merge pull request #2638 from eZioPan/update-metapac
update metapac
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32h7/src/bin/low_level_timer_api.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs
index cc508c3cf..049d9967d 100644
--- a/examples/stm32h7/src/bin/low_level_timer_api.rs
+++ b/examples/stm32h7/src/bin/low_level_timer_api.rs
@@ -113,11 +113,11 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> {
113 } 113 }
114 114
115 pub fn get_max_duty(&self) -> u32 { 115 pub fn get_max_duty(&self) -> u32 {
116 T::regs_gp32().arr().read().arr() 116 T::regs_gp32().arr().read()
117 } 117 }
118 118
119 pub fn set_duty(&mut self, channel: Channel, duty: u32) { 119 pub fn set_duty(&mut self, channel: Channel, duty: u32) {
120 defmt::assert!(duty < self.get_max_duty()); 120 defmt::assert!(duty < self.get_max_duty());
121 T::regs_gp32().ccr(channel.index()).modify(|w| w.set_ccr(duty)) 121 T::regs_gp32().ccr(channel.index()).write_value(duty)
122 } 122 }
123} 123}