hrtim: minor cleanup

This commit is contained in:
xoviat 2023-07-01 17:32:16 -05:00
parent 6e13f5b387
commit 21a8653195
3 changed files with 17 additions and 15 deletions

View File

@ -57,7 +57,7 @@ sdio-host = "0.5.0"
embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true }
critical-section = "1.1"
atomic-polyfill = "1.0.1"
stm32-metapac = "10"
stm32-metapac = "12"
vcell = "0.1.3"
bxcan = "0.7.0"
nb = "1.0.0"

View File

@ -187,8 +187,12 @@ impl<T: HighResolutionCaptureCompare16bitInstance, C: AdvancedChannel<T>> Bridge
T::regs().tim(C::raw()).cr().modify(|w| {
w.set_preen(true);
// TODO: fix metapac
w.set_cont(Cont(1));
w.set_cont(Cont::CONTINUOUS);
});
T::regs().oenr().modify(|w| {
w.set_t1oen(C::raw(), true);
w.set_t2oen(C::raw(), true);
});
// Set output 1 to active on a period event
@ -234,24 +238,23 @@ impl<T: HighResolutionCaptureCompare16bitInstance, C: AdvancedChannel<T>> Bridge
// TODO: fix metapac
T::regs().tim(C::raw()).outr().modify(|w| {
w.set_idlem(0, Idlem(1));
w.set_idlem(1, Idlem(1));
w.set_idlem(0, Idlem::SETIDLE);
w.set_idlem(1, Idlem::SETIDLE);
w.set_idles(0, Idles(1));
w.set_idles(1, Idles(1));
w.set_idles(0, Idles::INACTIVE);
w.set_idles(1, Idles::INACTIVE);
})
}
pub fn disable_burst_mode(&mut self) {
use crate::pac::hrtim::vals::{Idlem, Idles};
// TODO: fix metapac
T::regs().tim(C::raw()).outr().modify(|w| {
w.set_idlem(0, Idlem(0));
w.set_idlem(1, Idlem(0));
w.set_idlem(0, Idlem::NOEFFECT);
w.set_idlem(1, Idlem::NOEFFECT);
w.set_idles(0, Idles(0));
w.set_idles(1, Idles(0));
w.set_idles(0, Idles::INACTIVE);
w.set_idles(1, Idles::INACTIVE);
})
}
@ -303,8 +306,7 @@ impl<T: HighResolutionCaptureCompare16bitInstance, C: AdvancedChannel<T>> Resona
T::regs().tim(C::raw()).cr().modify(|w| {
w.set_preen(true);
// TODO: fix metapac
w.set_cont(Cont(1));
w.set_cont(Cont::CONTINUOUS);
w.set_half(true);
});

View File

@ -1,6 +1,6 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# replace STM32F429ZITx with your chip as listed in `probe-rs-cli chip list`
runner = "probe-rs-cli run --chip STM32F303ZETx"
runner = "probe-run --chip STM32F334R8"
[build]
target = "thumbv7em-none-eabihf"