[rp2] Use SDK clock query directly in arch_get_cpu_freq_hz (#18269)

This commit is contained in:
Jesse Hills
2026-08-11 08:23:08 -04:00
committed by GitHub
parent e5cdda9ee5
commit 2ff55e3058
+3 -1
View File
@@ -7,6 +7,7 @@
#include "crash_handler.h"
#endif
#include "hardware/clocks.h"
#include "hardware/watchdog.h"
// Empty rp2 namespace block to satisfy ci-custom's lint_namespace check.
@@ -33,7 +34,8 @@ void arch_init() {
#endif
}
uint32_t arch_get_cpu_freq_hz() { return RP2040::f_cpu(); }
// clock_get_hz(clk_sys) is the SDK query for the current system clock frequency in Hz.
uint32_t arch_get_cpu_freq_hz() { return clock_get_hz(clk_sys); }
} // namespace esphome