Skip to content

Commit

Permalink
Fix blinky build with new stm32-rs crate and remove power module
Browse files Browse the repository at this point in the history
  • Loading branch information
astapleton committed May 31, 2024
1 parent 7215055 commit 957cf43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
9 changes: 4 additions & 5 deletions examples/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions examples/utilities/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Utilities for examples
pub mod logger;
#[macro_use]
mod power;

15 changes: 0 additions & 15 deletions examples/utilities/power.rs

This file was deleted.

0 comments on commit 957cf43

Please sign in to comment.