Skip to content

Commit

Permalink
Fix delay on esp32h2
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed May 3, 2024
1 parent 5a8c76e commit 7895889
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions esp-hal/src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ mod implementation {
// The average clock frequency is fXTAL_CLK/2.5, which is 16 MHz.
// The timer counting is incremented by 1/16 μs on each `CNT_CLK` cycle.
Self {
#[cfg(not(esp32h2))]
freq: HertzU64::MHz(clocks.xtal_clock.to_MHz() as u64 * 10 / 25),
#[cfg(esp32h2)]
// esp32h2 TRM, section 11.2 Clock Source Selection
freq: HertzU64::MHz(clocks.xtal_clock.to_MHz() as u64 * 10 / 20),
}
}

Expand Down

0 comments on commit 7895889

Please sign in to comment.