Skip to content

Commit

Permalink
update for recent HAL API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewh42 committed Mar 2, 2024
1 parent 9e1e9d5 commit 0b274b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions rp2040-hal/examples/dormant_sleep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -176,7 +176,7 @@ fn main() -> ! {
}

/// Pulse an LED-connected pin the specified number of times.
fn pulse<P: ToggleableOutputPin>(pin: &mut P, count: u32) {
fn pulse<P: StatefulOutputPin>(pin: &mut P, count: u32) {
const LED_PULSE_CYCLES: u32 = 2_000_000;

for i in 0..count * 2 {
Expand Down
10 changes: 5 additions & 5 deletions rp2040-hal/src/pll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ impl<D: PhaseLockedLoopDevice> PhaseLockedLoop<Locked, D> {

/// Shut down the PLL. The returned PLL is configured the same as it was originally.
pub fn disable(self) -> PhaseLockedLoop<Disabled, D> {
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,
Expand Down

0 comments on commit 0b274b6

Please sign in to comment.