aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2022-10-28 16:31:22 -0400
committerBrian Cully <bjc@kublai.com>2022-10-28 16:31:22 -0400
commita9808211aeb98545d431a18e4a2fa8e3b2bd8218 (patch)
tree0c04a83ba17a9b6107ef47dabd251e9c8fdc62c3 /src/main.rs
parentfc890e991ed960c0f2f052f2664fc07a005f4ed3 (diff)
downloadluchie-a9808211aeb98545d431a18e4a2fa8e3b2bd8218.tar.gz
luchie-a9808211aeb98545d431a18e4a2fa8e3b2bd8218.zip
led: remove module, it's unnecessary
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();
}
}