From 93354b812c89c1b0d56f93181eae8484c625fe89 Mon Sep 17 00:00:00 2001 From: Mathias Date: Tue, 27 Sep 2022 05:51:38 +0200 Subject: [PATCH] Extend buffered-uart test to transmit 32 bytes --- tests/rp/src/bin/uart_buffered.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/rp/src/bin/uart_buffered.rs b/tests/rp/src/bin/uart_buffered.rs index a0a3df8d..4313ee3d 100644 --- a/tests/rp/src/bin/uart_buffered.rs +++ b/tests/rp/src/bin/uart_buffered.rs @@ -25,10 +25,16 @@ async fn main(_spawner: Spawner) { let mut state = State::new(); let mut uart = BufferedUart::new(&mut state, uart, irq, tx_buf, rx_buf); - let data = [0xC0, 0xDE]; + // Make sure we send more bytes than fits in the FIFO, to test the actual + // bufferedUart. + + let data = [ + 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(); - let mut buf = [0; 2]; + let mut buf = [0; 32]; uart.read(&mut buf).await.unwrap(); assert_eq!(buf, data);