diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32h7/src/bin/low_level_timer_api.rs | 4 |
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 | } |
