Added missing comments for timer setup
This commit is contained in:
parent
930d004e32
commit
fb67d421a2
22
src/main.rs
22
src/main.rs
|
@ -76,14 +76,15 @@ fn main() -> ! {
|
||||||
});
|
});
|
||||||
|
|
||||||
tim1.ccmr1_input().write(|w| {
|
tim1.ccmr1_input().write(|w| {
|
||||||
w.cc1s().ti1();
|
w.cc1s().ti1(); // Input capture using T1 input
|
||||||
w.ic1f().no_filter()
|
w.ic1f().no_filter() // No filter on input capture input
|
||||||
//w.ic1psc().bits(0)
|
|
||||||
|
//w.ic1psc().bits(0) // Disable prescaler, not safely implement by HAL yet
|
||||||
});
|
});
|
||||||
|
|
||||||
tim1.ccer.write(|w| {
|
tim1.ccer.write(|w| {
|
||||||
w.cc1p().set_bit();
|
w.cc1p().set_bit(); // Use rising edge on TI
|
||||||
w.cc1e().set_bit()
|
w.cc1e().set_bit() // Enable input capture
|
||||||
});
|
});
|
||||||
|
|
||||||
tim1.cr2.write(|w| {
|
tim1.cr2.write(|w| {
|
||||||
|
@ -104,14 +105,15 @@ fn main() -> ! {
|
||||||
});
|
});
|
||||||
|
|
||||||
tim2.ccmr1_input().write(|w| {
|
tim2.ccmr1_input().write(|w| {
|
||||||
w.cc1s().ti1();
|
w.cc1s().ti1(); // Input capture using T1 input
|
||||||
w.ic1f().no_filter()
|
w.ic1f().no_filter() // No filter on input capture input
|
||||||
//w.ic1psc().bits(0)
|
|
||||||
|
//w.ic1psc().bits(0) // Disable prescaler, not safely implement by HAL yet
|
||||||
});
|
});
|
||||||
|
|
||||||
tim2.ccer.write(|w| {
|
tim2.ccer.write(|w| {
|
||||||
w.cc1p().set_bit();
|
w.cc1p().set_bit(); // Use rising edge on TI
|
||||||
w.cc1e().set_bit()
|
w.cc1e().set_bit() // Enable input capture
|
||||||
});
|
});
|
||||||
|
|
||||||
tim1.cr1.write(|w| w.cen().enabled());
|
tim1.cr1.write(|w| w.cen().enabled());
|
||||||
|
|
Loading…
Reference in New Issue