This commit is contained in:
Juraj Sadel 2025-01-08 11:38:55 +01:00
parent afcb875629
commit c43d9adaa6
2 changed files with 12 additions and 4 deletions

View File

@ -21,7 +21,9 @@ mod tests {
let (rx, mut tx) = hil_test::common_test_pins!(peripherals);
let mut rx = UartRx::new(peripherals.UART1, uart::Config::default()).unwrap().with_rx(rx);
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 +31,9 @@ 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()).unwrap().with_tx(tx);
let mut tx = UartTx::new(peripherals.UART0, uart::Config::default())
.unwrap()
.with_tx(tx);
tx.flush().unwrap();
tx.write_bytes(&[0x42]).unwrap();

View File

@ -28,8 +28,12 @@ mod tests {
let (rx, tx) = hil_test::common_test_pins!(peripherals);
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);
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 }
}