mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 14:44:32 +00:00
Set up timer0 tick when initializing clocks
This commit is contained in:
parent
423e5d7655
commit
8c1024b2a5
@ -512,12 +512,18 @@ pub(crate) unsafe fn init(config: ClockConfig) {
|
|||||||
w.set_int(config.ref_clk.div);
|
w.set_int(config.ref_clk.div);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Configure tick generation on the 2040. On the 2350 the timers are driven from the sysclk.
|
// Configure tick generation on the 2040.
|
||||||
#[cfg(feature = "rp2040")]
|
#[cfg(feature = "rp2040")]
|
||||||
pac::WATCHDOG.tick().write(|w| {
|
pac::WATCHDOG.tick().write(|w| {
|
||||||
w.set_cycles((clk_ref_freq / 1_000_000) as u16);
|
w.set_cycles((clk_ref_freq / 1_000_000) as u16);
|
||||||
w.set_enable(true);
|
w.set_enable(true);
|
||||||
});
|
});
|
||||||
|
// Configure tick generator on the 2350
|
||||||
|
#[cfg(feature = "_rp235x")]
|
||||||
|
{
|
||||||
|
pac::TICKS.timer0_cycles().write(|w| w.0 = clk_ref_freq / 1_000_000);
|
||||||
|
pac::TICKS.timer0_ctrl().write(|w| w.set_enable(true));
|
||||||
|
}
|
||||||
|
|
||||||
let (sys_src, sys_aux, clk_sys_freq) = {
|
let (sys_src, sys_aux, clk_sys_freq) = {
|
||||||
use {ClkSysCtrlAuxsrc as Aux, ClkSysCtrlSrc as Src};
|
use {ClkSysCtrlAuxsrc as Aux, ClkSysCtrlSrc as Src};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user