From 7895889c5e6d3f637beef9485cba033e14a4eef3 Mon Sep 17 00:00:00 2001 From: Kirill Mikhailov Date: Fri, 3 May 2024 16:47:39 +0200 Subject: [PATCH] Fix delay on `esp32h2` --- esp-hal/src/delay.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esp-hal/src/delay.rs b/esp-hal/src/delay.rs index 72575de0fdd..e134ef5da1f 100644 --- a/esp-hal/src/delay.rs +++ b/esp-hal/src/delay.rs @@ -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), } }