forgotten tests

This commit is contained in:
Juraj Sadel 2025-01-08 11:33:17 +01:00
parent b59de9bb38
commit afcb875629
3 changed files with 8 additions and 6 deletions

View File

@ -21,7 +21,7 @@ mod tests {
let (rx, mut tx) = hil_test::common_test_pins!(peripherals); 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 // start reception
_ = rx.read_byte(); // this will just return WouldBlock _ = rx.read_byte(); // this will just return WouldBlock
@ -29,7 +29,7 @@ mod tests {
unsafe { tx.set_output_high(false, esp_hal::Internal::conjure()) }; unsafe { tx.set_output_high(false, esp_hal::Internal::conjure()) };
// set up TX and send a byte // 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.flush().unwrap();
tx.write_bytes(&[0x42]).unwrap(); tx.write_bytes(&[0x42]).unwrap();

View File

@ -28,8 +28,8 @@ mod tests {
let (rx, tx) = hil_test::common_test_pins!(peripherals); let (rx, tx) = hil_test::common_test_pins!(peripherals);
let tx = UartTx::new(peripherals.UART0, uart::Config::default(), tx).unwrap(); let tx = UartTx::new(peripherals.UART0, uart::Config::default()).unwrap().with_tx(tx);
let rx = UartRx::new(peripherals.UART1, uart::Config::default(), rx).unwrap(); let rx = UartRx::new(peripherals.UART1, uart::Config::default()).unwrap().with_rx(rx);
Context { rx, tx } Context { rx, tx }
} }

View File

@ -28,11 +28,13 @@ mod tests {
let (rx, tx) = hil_test::common_test_pins!(peripherals); 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() .unwrap()
.with_tx(tx)
.into_async(); .into_async();
let rx = UartRx::new(peripherals.UART1, uart::Config::default(), rx) let rx = UartRx::new(peripherals.UART1, uart::Config::default())
.unwrap() .unwrap()
.with_rx(rx)
.into_async(); .into_async();
Context { rx, tx } Context { rx, tx }