aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathias <[email protected]>2022-09-27 07:45:10 +0200
committerMathias <[email protected]>2022-09-27 07:45:10 +0200
commite129a97d48a00d7923886ab3faa82357b2369f13 (patch)
treee2aa1833e25562d5efa176db52c2b68456165100 /tests
parent93354b812c89c1b0d56f93181eae8484c625fe89 (diff)
Fix bufferedUart read and write tests
Diffstat (limited to 'tests')
-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 4313ee3dd..9cc20bb98 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) {
20 let uart = Uart::new_blocking(uart, tx, rx, config); 20 let uart = Uart::new_blocking(uart, tx, rx, config);
21 21
22 let irq = interrupt::take!(UART0_IRQ); 22 let irq = interrupt::take!(UART0_IRQ);
23 let tx_buf = &mut [0u8; 32]; 23 let tx_buf = &mut [0u8; 16];
24 let rx_buf = &mut [0u8; 32]; 24 let rx_buf = &mut [0u8; 16];
25 let mut state = State::new(); 25 let mut state = State::new();
26 let mut uart = BufferedUart::new(&mut state, uart, irq, tx_buf, rx_buf); 26 let mut uart = BufferedUart::new(&mut state, uart, irq, tx_buf, rx_buf);
27 27
@@ -32,10 +32,11 @@ async fn main(_spawner: Spawner) {
32 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, 32 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,
33 30, 31, 32, 33 30, 31, 32,
34 ]; 34 ];
35 uart.write(&data).await.unwrap(); 35 uart.write_all(&data).await.unwrap();
36 info!("Done writing");
36 37
37 let mut buf = [0; 32]; 38 let mut buf = [0; 32];
38 uart.read(&mut buf).await.unwrap(); 39 uart.read_exact(&mut buf).await.unwrap();
39 assert_eq!(buf, data); 40 assert_eq!(buf, data);
40 41
41 info!("Test OK"); 42 info!("Test OK");