diff options
| author | eZio Pan <[email protected]> | 2024-02-28 18:08:41 +0800 |
|---|---|---|
| committer | eZio Pan <[email protected]> | 2024-02-29 00:11:40 +0800 |
| commit | 47c579eba2a7b4372a891bcd747f2bb0c56ce8a4 (patch) | |
| tree | cd0baafd0bc85a0b4ef8a8c7cef695943472cdea /examples/stm32h7/src/bin/low_level_timer_api.rs | |
| parent | 5ced938184e141471e921d235975e95725d6be53 (diff) | |
update metapac
Diffstat (limited to 'examples/stm32h7/src/bin/low_level_timer_api.rs')
| -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 | } |
