Skip to content

Commit

Permalink
Make Clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sivakov512 committed Nov 5, 2023
1 parent 5b12c42 commit 3571393
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,35 @@ use bsp::entry;
use defmt_rtt as _;
use panic_probe as _;

use bsp::hal::{
clocks::{init_clocks_and_plls, Clock},
pac,
watchdog::Watchdog,
};

const DELAY_MS: u32 = 1_000;

#[entry]
fn main() -> ! {
loop {}
let mut pac = pac::Peripherals::take().unwrap();
let core = pac::CorePeripherals::take().unwrap();
let mut watchdog = Watchdog::new(pac.WATCHDOG);

let clocks = init_clocks_and_plls(
bsp::XOSC_CRYSTAL_FREQ,
pac.XOSC,
pac.CLOCKS,
pac.PLL_SYS,
pac.PLL_USB,
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz());

loop {
delay.delay_ms(DELAY_MS);
}
}

0 comments on commit 3571393

Please sign in to comment.