summaryrefslogtreecommitdiff
path: root/tests/rp
diff options
context:
space:
mode:
authorMathias <mk@blackbird.online>2022-09-27 07:45:10 +0200
committerMathias <mk@blackbird.online>2022-09-27 07:45:10 +0200
commite129a97d48a00d7923886ab3faa82357b2369f13 (patch)
treee2aa1833e25562d5efa176db52c2b68456165100 /tests/rp
parent93354b812c89c1b0d56f93181eae8484c625fe89 (diff)
downloadembassy-e129a97d48a00d7923886ab3faa82357b2369f13.zip
Fix bufferedUart read and write tests
Diffstat (limited to 'tests/rp')
-rw-r--r--tests/rp/src/bin/uart_buffered.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/rp/src/bin/uart_buffered.rs b/tests/rp/src/bin/uart_buffered.rs
index 4313ee3d..9cc20bb9 100644
--- a/tests/rp/src/bin/uart_buffered.rs
+++ b/tests/rp/src/bin/uart_buffered.rs
@@ -20,8 +20,8 @@ async fn main(_spawner: Spawner) {
let uart = Uart::new_blocking(uart, tx, rx, config);
let irq = interrupt::take!(UART0_IRQ);
- let tx_buf = &mut [0u8; 32];
- let rx_buf = &mut [0u8; 32];
+ let tx_buf = &mut [0u8; 16];
+ let rx_buf = &mut [0u8; 16];
let mut state = State::new();
let mut uart = BufferedUart::new(&mut state, uart, irq, tx_buf, rx_buf);
@@ -32,10 +32,11 @@ async fn main(_spawner: Spawner) {
1_u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32,
];
- uart.write(&data).await.unwrap();
+ uart.write_all(&data).await.unwrap();
+ info!("Done writing");
let mut buf = [0; 32];
- uart.read(&mut buf).await.unwrap();
+ uart.read_exact(&mut buf).await.unwrap();
assert_eq!(buf, data);
info!("Test OK");