Skip to content

Commit 7921747

Browse files
committed
H7 does not have DLL
1 parent c1fb984 commit 7921747

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/control.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ impl HrControltExt for HRTIM_COMMON {
7777
rcc.enable().reset();
7878

7979
// Start calibration procedure
80+
#[cfg(not(feature = "stm32h7"))]
8081
common
8182
.dllcr()
8283
.write(|w| w.cal().set_bit().calen().clear_bit());
@@ -173,6 +174,7 @@ impl HrTimOngoingCalibration {
173174
// Enable periodic calibration
174175
// with f_hrtim at 170MHz, these settings leads to
175176
// a period of about 6.2ms
177+
#[cfg(not(feature = "stm32h7"))]
176178
common
177179
.dllcr()
178180
.modify(|_r, w| w.calrte().bits(0b00).cal().set_bit().calen().clear_bit());
@@ -215,9 +217,12 @@ impl HrTimOngoingCalibration {
215217
}
216218

217219
pub fn wait_for_calibration(self) -> (HrTimCalibrated, FaultInputs, EevInputs) {
218-
let common = unsafe { &*HRTIM_COMMON::ptr() };
219-
while common.isr().read().dllrdy().bit_is_clear() {
220-
// Wait until ready
220+
#[cfg(not(feature = "stm32h7"))]
221+
{
222+
let common = unsafe { &*HRTIM_COMMON::ptr() };
223+
while common.isr().read().dllrdy().bit_is_clear() {
224+
// Wait until ready
225+
}
221226
}
222227

223228
// Calibration is now done, it is safe to continue

0 commit comments

Comments
 (0)