From 0b274b65ffdf68f6f22b2b5e525d527356ded988 Mon Sep 17 00:00:00 2001 From: Andrew Herbert Date: Sat, 2 Mar 2024 18:59:14 +1100 Subject: [PATCH] update for recent HAL API changes --- rp2040-hal/examples/dormant_sleep.rs | 4 ++-- rp2040-hal/src/pll.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rp2040-hal/examples/dormant_sleep.rs b/rp2040-hal/examples/dormant_sleep.rs index bb3ae2c14..ae3c709a2 100644 --- a/rp2040-hal/examples/dormant_sleep.rs +++ b/rp2040-hal/examples/dormant_sleep.rs @@ -26,7 +26,7 @@ use core::{cell::RefCell, ops::DerefMut}; use critical_section::Mutex; -use embedded_hal::digital::v2::ToggleableOutputPin; +use embedded_hal::digital::StatefulOutputPin; use fugit::RateExtU32; @@ -176,7 +176,7 @@ fn main() -> ! { } /// Pulse an LED-connected pin the specified number of times. -fn pulse(pin: &mut P, count: u32) { +fn pulse(pin: &mut P, count: u32) { const LED_PULSE_CYCLES: u32 = 2_000_000; for i in 0..count * 2 { diff --git a/rp2040-hal/src/pll.rs b/rp2040-hal/src/pll.rs index 7ca25c2b2..dbff55a80 100644 --- a/rp2040-hal/src/pll.rs +++ b/rp2040-hal/src/pll.rs @@ -281,13 +281,13 @@ impl PhaseLockedLoop { /// Shut down the PLL. The returned PLL is configured the same as it was originally. pub fn disable(self) -> PhaseLockedLoop { - let fbdiv = self.device.fbdiv_int.read().fbdiv_int().bits(); - let refdiv = self.device.cs.read().refdiv().bits(); - let prim = self.device.prim.read(); + let fbdiv = self.device.fbdiv_int().read().fbdiv_int().bits(); + let refdiv = self.device.cs().read().refdiv().bits(); + let prim = self.device.prim().read(); let frequency = self.state.frequency; - self.device.pwr.reset(); - self.device.fbdiv_int.reset(); + self.device.pwr().reset(); + self.device.fbdiv_int().reset(); self.transition(Disabled { refdiv,