Improve test runtime

This commit is contained in:
Emil Fresk 2022-09-24 14:24:59 +02:00
parent 1341cc5bbe
commit ecf5e6e334
5 changed files with 16 additions and 16 deletions

View file

@ -1,4 +1,4 @@
foo Instant { ticks: 0 }
foo Instant { ticks: 100 }
foo Instant { ticks: 200 }
foo Instant { ticks: 300 }
foo Instant { ticks: 10 }
foo Instant { ticks: 20 }
foo Instant { ticks: 30 }

View file

@ -1,7 +1,7 @@
foo Instant { ticks: 0 }
bar Instant { ticks: 10 }
foo Instant { ticks: 110 }
bar Instant { ticks: 120 }
foo Instant { ticks: 220 }
bar Instant { ticks: 230 }
foo Instant { ticks: 330 }
foo Instant { ticks: 30 }
bar Instant { ticks: 40 }
foo Instant { ticks: 60 }
bar Instant { ticks: 70 }
foo Instant { ticks: 90 }

View file

@ -42,8 +42,8 @@ mod app {
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
}
// Periodic ever 1 seconds
let next_instant = instant + 1.secs();
// Periodic every 100 milliseconds
let next_instant = instant + 100.millis();
foo::spawn_at(next_instant, next_instant).unwrap();
}
}

View file

@ -28,7 +28,7 @@ mod app {
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
let mut mono = Systick::new(systick, 12_000_000);
foo::spawn_after(1.secs(), mono.now()).unwrap();
foo::spawn_after(200.millis(), mono.now()).unwrap();
(Shared {}, Local {}, init::Monotonics(mono))
}
@ -54,8 +54,8 @@ mod app {
fn bar(_cx: bar::Context, instant: <MyMono as rtic_monotonic::Monotonic>::Instant) {
hprintln!("bar {:?}", instant).ok();
// Spawn a new message with 1s offset to spawned time
let next_instant = instant + 1.secs();
// Spawn a new message with 200ms offset to spawned time
let next_instant = instant + 200.millis();
foo::spawn_at(next_instant, next_instant).unwrap();
}
}

View file

@ -28,7 +28,7 @@ mod app {
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
let mono = Systick::new(systick, 12_000_000);
foo::spawn_after(1.secs()).unwrap();
foo::spawn_after(100.millis()).unwrap();
(Shared {}, Local {}, init::Monotonics(mono))
}
@ -42,7 +42,7 @@ mod app {
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
}
// Periodic ever 1 seconds
foo::spawn_after(1.secs()).unwrap();
// Periodic every 100ms
foo::spawn_after(100.millis()).unwrap();
}
}