diff options
| author | xoviat <[email protected]> | 2023-07-01 17:32:16 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-07-01 17:32:16 -0500 |
| commit | 21a86531955facbdba5583b5218e20f1ca6dc23e (patch) | |
| tree | e294d8da6a641d2fdd004dc232419166d836456e | |
| parent | 6e13f5b387d8f0f948b5874bc300925b015947d9 (diff) | |
hrtim: minor cleanup
| -rw-r--r-- | embassy-stm32/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/pwm/advanced_pwm.rs | 28 | ||||
| -rw-r--r-- | examples/stm32f334/.cargo/config.toml | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 3d9ee8261..551c09698 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -57,7 +57,7 @@ sdio-host = "0.5.0" | |||
| 57 | embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true } | 57 | embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true } |
| 58 | critical-section = "1.1" | 58 | critical-section = "1.1" |
| 59 | atomic-polyfill = "1.0.1" | 59 | atomic-polyfill = "1.0.1" |
| 60 | stm32-metapac = "10" | 60 | stm32-metapac = "12" |
| 61 | vcell = "0.1.3" | 61 | vcell = "0.1.3" |
| 62 | bxcan = "0.7.0" | 62 | bxcan = "0.7.0" |
| 63 | nb = "1.0.0" | 63 | nb = "1.0.0" |
diff --git a/embassy-stm32/src/pwm/advanced_pwm.rs b/embassy-stm32/src/pwm/advanced_pwm.rs index 7e595421c..65f4e7ca7 100644 --- a/embassy-stm32/src/pwm/advanced_pwm.rs +++ b/embassy-stm32/src/pwm/advanced_pwm.rs | |||
| @@ -187,8 +187,12 @@ impl<T: HighResolutionCaptureCompare16bitInstance, C: AdvancedChannel<T>> Bridge | |||
| 187 | T::regs().tim(C::raw()).cr().modify(|w| { | 187 | T::regs().tim(C::raw()).cr().modify(|w| { |
| 188 | w.set_preen(true); | 188 | w.set_preen(true); |
| 189 | 189 | ||
| 190 | // TODO: fix metapac | 190 | w.set_cont(Cont::CONTINUOUS); |
| 191 | w.set_cont(Cont(1)); | 191 | }); |
| 192 | |||
| 193 | T::regs().oenr().modify(|w| { | ||
| 194 | w.set_t1oen(C::raw(), true); | ||
| 195 | w.set_t2oen(C::raw(), true); | ||
| 192 | }); | 196 | }); |
| 193 | 197 | ||
| 194 | // Set output 1 to active on a period event | 198 | // Set output 1 to active on a period event |
| @@ -234,24 +238,23 @@ impl<T: HighResolutionCaptureCompare16bitInstance, C: AdvancedChannel<T>> Bridge | |||
| 234 | 238 | ||
| 235 | // TODO: fix metapac | 239 | // TODO: fix metapac |
| 236 | T::regs().tim(C::raw()).outr().modify(|w| { | 240 | T::regs().tim(C::raw()).outr().modify(|w| { |
| 237 | w.set_idlem(0, Idlem(1)); | 241 | w.set_idlem(0, Idlem::SETIDLE); |
| 238 | w.set_idlem(1, Idlem(1)); | 242 | w.set_idlem(1, Idlem::SETIDLE); |
| 239 | 243 | ||
| 240 | w.set_idles(0, Idles(1)); | 244 | w.set_idles(0, Idles::INACTIVE); |
| 241 | w.set_idles(1, Idles(1)); | 245 | w.set_idles(1, Idles::INACTIVE); |
| 242 | }) | 246 | }) |
| 243 | } | 247 | } |
| 244 | 248 | ||
| 245 | pub fn disable_burst_mode(&mut self) { | 249 | pub fn disable_burst_mode(&mut self) { |
| 246 | use crate::pac::hrtim::vals::{Idlem, Idles}; | 250 | use crate::pac::hrtim::vals::{Idlem, Idles}; |
| 247 | 251 | ||
| 248 | // TODO: fix metapac | ||
| 249 | T::regs().tim(C::raw()).outr().modify(|w| { | 252 | T::regs().tim(C::raw()).outr().modify(|w| { |
| 250 | w.set_idlem(0, Idlem(0)); | 253 | w.set_idlem(0, Idlem::NOEFFECT); |
| 251 | w.set_idlem(1, Idlem(0)); | 254 | w.set_idlem(1, Idlem::NOEFFECT); |
| 252 | 255 | ||
| 253 | w.set_idles(0, Idles(0)); | 256 | w.set_idles(0, Idles::INACTIVE); |
| 254 | w.set_idles(1, Idles(0)); | 257 | w.set_idles(1, Idles::INACTIVE); |
| 255 | }) | 258 | }) |
| 256 | } | 259 | } |
| 257 | 260 | ||
| @@ -303,8 +306,7 @@ impl<T: HighResolutionCaptureCompare16bitInstance, C: AdvancedChannel<T>> Resona | |||
| 303 | T::regs().tim(C::raw()).cr().modify(|w| { | 306 | T::regs().tim(C::raw()).cr().modify(|w| { |
| 304 | w.set_preen(true); | 307 | w.set_preen(true); |
| 305 | 308 | ||
| 306 | // TODO: fix metapac | 309 | w.set_cont(Cont::CONTINUOUS); |
| 307 | w.set_cont(Cont(1)); | ||
| 308 | w.set_half(true); | 310 | w.set_half(true); |
| 309 | }); | 311 | }); |
| 310 | 312 | ||
diff --git a/examples/stm32f334/.cargo/config.toml b/examples/stm32f334/.cargo/config.toml index 7f3fda529..caf947be6 100644 --- a/examples/stm32f334/.cargo/config.toml +++ b/examples/stm32f334/.cargo/config.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] |
| 2 | # replace STM32F429ZITx with your chip as listed in `probe-rs-cli chip list` | 2 | # replace STM32F429ZITx with your chip as listed in `probe-rs-cli chip list` |
| 3 | runner = "probe-rs-cli run --chip STM32F303ZETx" | 3 | runner = "probe-run --chip STM32F334R8" |
| 4 | 4 | ||
| 5 | [build] | 5 | [build] |
| 6 | target = "thumbv7em-none-eabihf" | 6 | target = "thumbv7em-none-eabihf" |
