From d37d5726ce73cdbfe1df4f537998b4b7e0d0df01 Mon Sep 17 00:00:00 2001 From: Michael Mogenson Date: Wed, 27 Mar 2019 11:37:44 -0400 Subject: [PATCH 1/2] write_fmt() method needed for write!() macro Include `use core::fmt::Write;` in serial example. --- src/hello-world/02.00.UART.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hello-world/02.00.UART.md b/src/hello-world/02.00.UART.md index b661a02..4b7af7d 100644 --- a/src/hello-world/02.00.UART.md +++ b/src/hello-world/02.00.UART.md @@ -24,6 +24,7 @@ To read and write to the serial bus from your computer, you will need to configu ## Code ``` rust +use core::fmt::Write; use microbit::hal::prelude::*; use microbit::hal::serial; use microbit::hal::serial::BAUD115200; From 7641877efec4096d6e2224cb86aa92bd47ccad01 Mon Sep 17 00:00:00 2001 From: Michael Mogenson Date: Wed, 27 Mar 2019 11:39:35 -0400 Subject: [PATCH 2/2] Remove unused mut `gpio` does not need to be mutable. Remove `mut` to silence build warning. --- src/hello-world/02.00.UART.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hello-world/02.00.UART.md b/src/hello-world/02.00.UART.md index 4b7af7d..b3452cb 100644 --- a/src/hello-world/02.00.UART.md +++ b/src/hello-world/02.00.UART.md @@ -30,7 +30,7 @@ use microbit::hal::serial; use microbit::hal::serial::BAUD115200; // -- snip -- if let Some(p) = microbit::Peripherals::take() { - let mut gpio = p.GPIO.split(); + let gpio = p.GPIO.split(); // Configure RX and TX pins accordingly let tx = gpio.pin24.into_push_pull_output().downgrade(); let rx = gpio.pin25.into_floating_input().downgrade();