From 7336b8cd88daf5299ee7f5b329028bbb64051fc6 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 30 Apr 2023 08:26:57 +0200 Subject: [PATCH] rp/uart: add UartRx::new_blocking --- embassy-rp/src/uart/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index dedc390f..f4a93f63 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs @@ -229,6 +229,16 @@ impl<'d, T: Instance, M: Mode> UartRx<'d, T, M> { } impl<'d, T: Instance> UartRx<'d, T, Blocking> { + pub fn new_blocking( + _uart: impl Peripheral

+ 'd, + rx: impl Peripheral

> + 'd, + config: Config, + ) -> Self { + into_ref!(rx); + Uart::::init(None, Some(rx.map_into()), None, None, config); + Self::new_inner(None) + } + #[cfg(feature = "nightly")] pub fn into_buffered( self,