Extend buffered-uart test to transmit 32 bytes

This commit is contained in:
Mathias 2022-09-27 05:51:38 +02:00
parent 65907204d6
commit 93354b812c

View File

@ -25,10 +25,16 @@ async fn main(_spawner: Spawner) {
let mut state = State::new(); let mut state = State::new();
let mut uart = BufferedUart::new(&mut state, uart, irq, tx_buf, rx_buf); 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(); uart.write(&data).await.unwrap();
let mut buf = [0; 2]; let mut buf = [0; 32];
uart.read(&mut buf).await.unwrap(); uart.read(&mut buf).await.unwrap();
assert_eq!(buf, data); assert_eq!(buf, data);