aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rwxr-xr-xsrc/main.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 1697001..8c2bac1 100755
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,11 +4,9 @@
//extern crate panic_semihosting;
mod cirque;
-mod led;
mod log;
use cirque::Cirque;
-use led::LED;
use cortex_m::{
asm::{bkpt, wfi},
@@ -43,7 +41,8 @@ fn main() -> ! {
assert!(clocks.usbclk_valid());
let mut gpiob = dp.GPIOB.split();
- let mut led = LED::new(gpiob.pb2, &mut gpiob.crl);
+ let mut led = gpiob.pb2.into_push_pull_output(&mut gpiob.crl);
+ led.set_low();
let mut afio = dp.AFIO.constrain();
let mut gpioa = dp.GPIOA.split();
@@ -141,7 +140,7 @@ fn main() -> ! {
match serial.read(&mut buf) {
Ok(count) if count > 0 => {
- led.on();
+ led.set_high();
// Echo back in upper case
for c in buf[0..count].iter_mut() {
@@ -159,11 +158,10 @@ fn main() -> ! {
_ => {}
}
}
+ led.set_low();
}
_ => {}
}
-
- led.off();
}
}