From afcb875629eac618d7f8d1ab5c7209845e941acb Mon Sep 17 00:00:00 2001 From: Juraj Sadel Date: Wed, 8 Jan 2025 11:33:17 +0100 Subject: [PATCH] forgotten tests --- hil-test/tests/uart_regression.rs | 4 ++-- hil-test/tests/uart_tx_rx.rs | 4 ++-- hil-test/tests/uart_tx_rx_async.rs | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hil-test/tests/uart_regression.rs b/hil-test/tests/uart_regression.rs index de1d9ad0275..1bfb18af578 100644 --- a/hil-test/tests/uart_regression.rs +++ b/hil-test/tests/uart_regression.rs @@ -21,7 +21,7 @@ mod tests { let (rx, mut tx) = hil_test::common_test_pins!(peripherals); - let mut rx = UartRx::new(peripherals.UART1, uart::Config::default(), rx).unwrap(); + let mut rx = UartRx::new(peripherals.UART1, uart::Config::default()).unwrap().with_rx(rx); // start reception _ = rx.read_byte(); // this will just return WouldBlock @@ -29,7 +29,7 @@ mod tests { unsafe { tx.set_output_high(false, esp_hal::Internal::conjure()) }; // set up TX and send a byte - let mut tx = UartTx::new(peripherals.UART0, uart::Config::default(), tx).unwrap(); + let mut tx = UartTx::new(peripherals.UART0, uart::Config::default()).unwrap().with_tx(tx); tx.flush().unwrap(); tx.write_bytes(&[0x42]).unwrap(); diff --git a/hil-test/tests/uart_tx_rx.rs b/hil-test/tests/uart_tx_rx.rs index fb20e0b26d8..76e539d3046 100644 --- a/hil-test/tests/uart_tx_rx.rs +++ b/hil-test/tests/uart_tx_rx.rs @@ -28,8 +28,8 @@ mod tests { let (rx, tx) = hil_test::common_test_pins!(peripherals); - let tx = UartTx::new(peripherals.UART0, uart::Config::default(), tx).unwrap(); - let rx = UartRx::new(peripherals.UART1, uart::Config::default(), rx).unwrap(); + let tx = UartTx::new(peripherals.UART0, uart::Config::default()).unwrap().with_tx(tx); + let rx = UartRx::new(peripherals.UART1, uart::Config::default()).unwrap().with_rx(rx); Context { rx, tx } } diff --git a/hil-test/tests/uart_tx_rx_async.rs b/hil-test/tests/uart_tx_rx_async.rs index 30b916e7584..5e8822a01aa 100644 --- a/hil-test/tests/uart_tx_rx_async.rs +++ b/hil-test/tests/uart_tx_rx_async.rs @@ -28,11 +28,13 @@ mod tests { let (rx, tx) = hil_test::common_test_pins!(peripherals); - let tx = UartTx::new(peripherals.UART0, uart::Config::default(), tx) + let tx = UartTx::new(peripherals.UART0, uart::Config::default()) .unwrap() + .with_tx(tx) .into_async(); - let rx = UartRx::new(peripherals.UART1, uart::Config::default(), rx) + let rx = UartRx::new(peripherals.UART1, uart::Config::default()) .unwrap() + .with_rx(rx) .into_async(); Context { rx, tx }