sam354xplaintedpro: use v2 API

This commit is contained in:
Thomas Klaehn 2022-01-11 08:21:25 +01:00
parent 3f69a4fe54
commit 6d1e159f4c

View File

@ -9,7 +9,7 @@ use panic_halt as _;
#[cfg(feature = "use_semihosting")] #[cfg(feature = "use_semihosting")]
use panic_semihosting as _; use panic_semihosting as _;
use bsp::entry; use bsp::{entry, gpio::v2::Pins, gpio::v2::ReadableOutput};
use hal::clock::GenericClockController; use hal::clock::GenericClockController;
use hal::delay::Delay; use hal::delay::Delay;
use hal::pac::{CorePeripherals, Peripherals}; use hal::pac::{CorePeripherals, Peripherals};
@ -31,8 +31,8 @@ fn main() -> ! {
let mut delay = Delay::new(core.SYST, &mut clocks); let mut delay = Delay::new(core.SYST, &mut clocks);
delay.delay_ms(400u16); delay.delay_ms(400u16);
let mut pins = bsp::Pins::new(peripherals.PORT); let pins = Pins::new(peripherals.PORT);
let mut led = pins.led.into_open_drain_output(&mut pins.port); let mut led = pins.pc18.into_mode::<ReadableOutput>();
let mut wdt = Watchdog::new(peripherals.WDT); let mut wdt = Watchdog::new(peripherals.WDT);
wdt.start(WatchdogTimeout::Cycles256 as u8); wdt.start(WatchdogTimeout::Cycles256 as u8);