sam354xplaintedpro: use v2 API
This commit is contained in:
parent
3f69a4fe54
commit
6d1e159f4c
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user