small clippy fixes

This commit is contained in:
Michael Droogleever
2018-08-18 02:02:46 +02:00
parent bf5cb69f27
commit 29cb6f45f7
2 changed files with 5 additions and 7 deletions

View File

@@ -141,7 +141,8 @@ fn main() -> ! {
let rx = gpio.pin25.into_floating_input().downgrade();
// Configure serial communication
let (mut tx, _) = serial::Serial::uart0(p.UART0, tx, rx, BAUD115200).split();
write!(tx, "serial - start\r\n");
writeln!(tx, "");
writeln!(tx, "Init");
// Create delay provider
let mut delay = Delay::new(p.TIMER0);
@@ -192,10 +193,10 @@ fn main() -> ! {
[0, 1, 1, 1, 0],
];
let _ = write!(tx, "\n\rStarting!\n\r");
writeln!(tx, "Starting!");
loop {
let _ = write!(tx, "I <3 Rust on the micro:bit!\n\r");
writeln!(tx, "I <3 Rust on the micro:bit!");
leds.display(&mut delay, letter_I, 1000);
leds.display(&mut delay, heart, 1000);
leds.display(&mut delay, letter_U, 1000);

View File

@@ -13,7 +13,6 @@ use rt::ExceptionFrame;
use sh::hio;
use microbit::hal::prelude::*;
use microbit::hal::delay::Delay;
use microbit::hal::serial;
use microbit::hal::serial::BAUD115200;
@@ -36,14 +35,12 @@ fn main() -> ! {
if let Some(p) = microbit::Peripherals::take() {
// Split GPIO
let mut gpio = p.GPIO.split();
// Create delay provider
let mut delay = Delay::new(p.TIMER0);
// Configure RX and TX pins accordingly
let tx = gpio.pin24.into_push_pull_output().downgrade();
let rx = gpio.pin25.into_floating_input().downgrade();
// Configure serial communication
let (mut tx, mut rx) = serial::Serial::uart0(p.UART0, tx, rx, BAUD115200).split();
write!(tx, "Start\r\n");
writeln!(tx, "Start");
loop {
let val = block!(rx.read()).unwrap();
block!(tx.write(val));