Skip to content

Commit c13e5c9

Browse files
committed
Use HCLK instead of SYSCLK in DelayUs
The SysTick is directly fed by HCLK, so that is the value we must use to compute the reload value.
1 parent 5fce562 commit c13e5c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/delay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl DelayUs<u32> for Delay {
5353
// The SysTick Reload Value register supports values between 1 and 0x00FFFFFF.
5454
const MAX_RVR: u32 = 0x00FF_FFFF;
5555

56-
let mut total_rvr = us * (self.clocks.sysclk().0 / 1_000_000);
56+
let mut total_rvr = us * (self.clocks.hclk().0 / 1_000_000);
5757

5858
while total_rvr != 0 {
5959
let current_rvr = if total_rvr <= MAX_RVR {

0 commit comments

Comments
 (0)