summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathias <mk@blackbird.online>2022-09-27 05:51:38 +0200
committerMathias <mk@blackbird.online>2022-09-27 05:54:31 +0200
commit93354b812c89c1b0d56f93181eae8484c625fe89 (patch)
treeb19f2f7d64fc2111307d655fb4352e49005ecec0 /tests
parent65907204d64f104bfa5bf1ea9d1da8cb9cc09d19 (diff)
downloadembassy-93354b812c89c1b0d56f93181eae8484c625fe89.zip
Extend buffered-uart test to transmit 32 bytes
Diffstat (limited to 'tests')
-rw-r--r--tests/rp/src/bin/uart_buffered.rs10
1 files 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);