Merge #1465
1465: rp: continue clock rework r=Dirbaio a=pennae vastly reduce the code size of initial clock config (over 700 bytes saved!), at the cost of about 48 bytes of ram used to store the frequencies of all clocks in the system. also stop exporting unstable pac items for clock config, fix a few settings that were out of spec, and add missing features (most notably gpin source information). Co-authored-by: pennae <github@quasiparticle.net>
This commit is contained in:
commit
4b303949bf
File diff suppressed because it is too large
Load Diff
@ -26,12 +26,7 @@ impl<'d, T: Instance> RealTimeClock<'d, T> {
|
||||
into_ref!(inner);
|
||||
|
||||
// Set the RTC divider
|
||||
unsafe {
|
||||
inner
|
||||
.regs()
|
||||
.clkdiv_m1()
|
||||
.write(|w| w.set_clkdiv_m1(clk_rtc_freq() as u16 - 1))
|
||||
};
|
||||
unsafe { inner.regs().clkdiv_m1().write(|w| w.set_clkdiv_m1(clk_rtc_freq() - 1)) };
|
||||
|
||||
let mut result = Self { inner };
|
||||
result.set_leap_year_check(true); // should be on by default, make sure this is the case.
|
||||
|
@ -17,14 +17,14 @@ async fn main(_spawner: Spawner) {
|
||||
gpout3.enable();
|
||||
|
||||
loop {
|
||||
gpout3.set_src(clocks::GpoutSrc::CLK_SYS);
|
||||
gpout3.set_src(clocks::GpoutSrc::Sys);
|
||||
info!(
|
||||
"Pin 25 is now outputing CLK_SYS/1000, should be toggling at {}",
|
||||
gpout3.get_freq()
|
||||
);
|
||||
Timer::after(Duration::from_secs(2)).await;
|
||||
|
||||
gpout3.set_src(clocks::GpoutSrc::CLK_REF);
|
||||
gpout3.set_src(clocks::GpoutSrc::Ref);
|
||||
info!(
|
||||
"Pin 25 is now outputing CLK_REF/1000, should be toggling at {}",
|
||||
gpout3.get_freq()
|
||||
|
Loading…
Reference in New Issue
Block a user