diff --git a/examples/blinky.rs b/examples/blinky.rs index e99f3db..e7b28c5 100644 --- a/examples/blinky.rs +++ b/examples/blinky.rs @@ -10,22 +10,21 @@ use stm32h5xx_hal::pac; fn main() -> ! { utilities::logger::init(); - let cp = cortex_m::Peripherals::take().unwrap(); let dp = pac::Peripherals::take().unwrap(); // TODO: Power/clock config is required before blinky can... blink. - dp.GPIOA.moder.write(|w| w.mode5().variant(1)); // output - dp.GPIOA.pupdr.write(|w| w.pupd5().variant(1)); // pull-up + dp.GPIOA.moder().write(|w| w.mode5().output()); // output + dp.GPIOA.pupdr().write(|w| w.pupd5().pull_up()); // pull-up // dp.GPIOA.odr.write(|w| w.od5().set_bit()); loop { - dp.GPIOA.odr.write(|w| w.od5().clear_bit()); + dp.GPIOA.odr().write(|w| w.od5().low()); for _ in 0..1_000_0 { cortex_m::asm::nop(); } - dp.GPIOA.odr.write(|w| w.od5().set_bit()); + dp.GPIOA.odr().write(|w| w.od5().high()); for _ in 0..1_000_0 { cortex_m::asm::nop(); } diff --git a/examples/utilities/mod.rs b/examples/utilities/mod.rs index 39e92a3..1221313 100644 --- a/examples/utilities/mod.rs +++ b/examples/utilities/mod.rs @@ -1,5 +1,4 @@ //! Utilities for examples pub mod logger; -#[macro_use] -mod power; + diff --git a/examples/utilities/power.rs b/examples/utilities/power.rs deleted file mode 100644 index a08d9c5..0000000 --- a/examples/utilities/power.rs +++ /dev/null @@ -1,15 +0,0 @@ -//! Power Configuration for examples - -macro_rules! example_power { - ($pwr:ident) => {{ - cfg_if::cfg_if! { - if #[cfg(all(feature = "smps", feature = "example-smps"))] { - $pwr.smps() - } else if #[cfg(all(feature = "smps", feature = "example-ldo"))] { - $pwr.ldo() - } else { - $pwr - } - } - }}; -}