Skip to content

Commit

Permalink
Adjust test to a more realistic clock frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 4, 2024
1 parent 50ee7c4 commit f437287
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hil-test/tests/spi_full_duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,11 @@ mod tests {
}

#[test]
#[timeout(3)]
#[timeout(2)]
fn cancel_stops_transaction(mut ctx: Context) {
// Slow down
ctx.spi.change_bus_frequency(100.Hz());
// Slow down. At 80kHz, the transfer is supposed to take a bit over 3 seconds. This means
// that without working cancellation, the test case should fail.
ctx.spi.change_bus_frequency(80.kHz());

// Set up a large buffer that would trigger a timeout
let dma_rx_buf = DmaRxBuf::new(ctx.rx_descriptors, ctx.rx_buffer).unwrap();
Expand All @@ -513,8 +514,8 @@ mod tests {
#[test]
#[timeout(3)]
fn can_transmit_after_cancel(mut ctx: Context) {
// Slow down
ctx.spi.change_bus_frequency(100.Hz());
// Slow down. At 80kHz, the transfer is supposed to take a bit over 3 seconds.
ctx.spi.change_bus_frequency(80.kHz());

// Set up a large buffer that would trigger a timeout
let mut dma_rx_buf = DmaRxBuf::new(ctx.rx_descriptors, ctx.rx_buffer).unwrap();
Expand Down

0 comments on commit f437287

Please sign in to comment.