From d129479e797d09e2e1f033ac1451a3f8fd0fd401 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Tue, 18 Oct 2022 09:58:27 +0300 Subject: [PATCH] fix removed Tx::Write --- CHANGELOG.md | 3 ++- src/serial/hal_02.rs | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 574dd973..721c9c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added -- Serial Tx, Rx containing pins [#514] [#515] +- Serial Tx, Rx containing pins [#514] [#515] [#540] - Implementation of From trait for Pin-to-PartiallyErasedPin [#507] - Implementation of From trait for Pin-to-ErasedPin [#507] - Implementation of From trait for PartiallyErasedPin-to-ErasedPin [#507] @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). [#529]: https://github.com/stm32-rs/stm32f4xx-hal/pull/529 [#536]: https://github.com/stm32-rs/stm32f4xx-hal/pull/536 [#534]: https://github.com/stm32-rs/stm32f4xx-hal/pull/529 +[#540]: https://github.com/stm32-rs/stm32f4xx-hal/pull/540 ## [v0.13.2] - 2022-05-16 diff --git a/src/serial/hal_02.rs b/src/serial/hal_02.rs index 80b47373..cdd631aa 100644 --- a/src/serial/hal_02.rs +++ b/src/serial/hal_02.rs @@ -51,6 +51,17 @@ mod nb { } } + impl Write for Tx { + type Error = Error; + + fn write(&mut self, word: u8) -> nb::Result<(), Self::Error> { + self.write(word) + } + fn flush(&mut self) -> nb::Result<(), Self::Error> { + self.flush() + } + } + /// Writes 9-bit words to the UART/USART /// /// If the UART/USART was configured with `WordLength::DataBits9`, the 9 least significant bits will