aboutsummaryrefslogtreecommitdiff
path: root/tests/rp/src/bin/uart.rs
diff options
context:
space:
mode:
authorMarc <[email protected]>2025-05-02 12:52:04 +0200
committerMarc <[email protected]>2025-05-02 12:52:04 +0200
commit1efe59ec475aa38948d1fc95feb34860f08c8dcd (patch)
tree44cbe968776fee914f087232cb445a492e4caa33 /tests/rp/src/bin/uart.rs
parent2fd803f7c336dd6aa042c34e11e213e6e4eb13ad (diff)
Update examples and tests
Diffstat (limited to 'tests/rp/src/bin/uart.rs')
-rw-r--r--tests/rp/src/bin/uart.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/rp/src/bin/uart.rs b/tests/rp/src/bin/uart.rs
index 84744ab77..80230f3fe 100644
--- a/tests/rp/src/bin/uart.rs
+++ b/tests/rp/src/bin/uart.rs
@@ -8,17 +8,17 @@ teleprobe_meta::target!(b"pimoroni-pico-plus-2");
8use defmt::{assert_eq, *}; 8use defmt::{assert_eq, *};
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_rp::gpio::{Level, Output}; 10use embassy_rp::gpio::{Level, Output};
11use embassy_rp::uart::{Blocking, Config, Error, Instance, Parity, Uart, UartRx}; 11use embassy_rp::uart::{Blocking, Config, Error, Parity, Uart, UartRx};
12use embassy_time::Timer; 12use embassy_time::Timer;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15fn read<const N: usize>(uart: &mut Uart<'_, impl Instance, Blocking>) -> Result<[u8; N], Error> { 15fn read<const N: usize>(uart: &mut Uart<'_, Blocking>) -> Result<[u8; N], Error> {
16 let mut buf = [255; N]; 16 let mut buf = [255; N];
17 uart.blocking_read(&mut buf)?; 17 uart.blocking_read(&mut buf)?;
18 Ok(buf) 18 Ok(buf)
19} 19}
20 20
21fn read1<const N: usize>(uart: &mut UartRx<'_, impl Instance, Blocking>) -> Result<[u8; N], Error> { 21fn read1<const N: usize>(uart: &mut UartRx<'_, Blocking>) -> Result<[u8; N], Error> {
22 let mut buf = [255; N]; 22 let mut buf = [255; N];
23 uart.blocking_read(&mut buf)?; 23 uart.blocking_read(&mut buf)?;
24 Ok(buf) 24 Ok(buf)