Skip to content

Commit

Permalink
forgotten tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajSadel committed Jan 8, 2025
1 parent b59de9b commit afcb875
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions hil-test/tests/uart_regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ 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

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();
Expand Down
4 changes: 2 additions & 2 deletions hil-test/tests/uart_tx_rx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down
6 changes: 4 additions & 2 deletions hil-test/tests/uart_tx_rx_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit afcb875

Please sign in to comment.