mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 20:22:51 +01:00
Improve test runtime
This commit is contained in:
parent
1341cc5bbe
commit
ecf5e6e334
5 changed files with 16 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
||||||
foo Instant { ticks: 0 }
|
foo Instant { ticks: 0 }
|
||||||
foo Instant { ticks: 100 }
|
foo Instant { ticks: 10 }
|
||||||
foo Instant { ticks: 200 }
|
foo Instant { ticks: 20 }
|
||||||
foo Instant { ticks: 300 }
|
foo Instant { ticks: 30 }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
foo Instant { ticks: 0 }
|
foo Instant { ticks: 0 }
|
||||||
bar Instant { ticks: 10 }
|
bar Instant { ticks: 10 }
|
||||||
foo Instant { ticks: 110 }
|
foo Instant { ticks: 30 }
|
||||||
bar Instant { ticks: 120 }
|
bar Instant { ticks: 40 }
|
||||||
foo Instant { ticks: 220 }
|
foo Instant { ticks: 60 }
|
||||||
bar Instant { ticks: 230 }
|
bar Instant { ticks: 70 }
|
||||||
foo Instant { ticks: 330 }
|
foo Instant { ticks: 90 }
|
||||||
|
|
|
@ -42,8 +42,8 @@ mod app {
|
||||||
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
|
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
|
||||||
}
|
}
|
||||||
|
|
||||||
// Periodic ever 1 seconds
|
// Periodic every 100 milliseconds
|
||||||
let next_instant = instant + 1.secs();
|
let next_instant = instant + 100.millis();
|
||||||
foo::spawn_at(next_instant, next_instant).unwrap();
|
foo::spawn_at(next_instant, next_instant).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ mod app {
|
||||||
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
|
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
|
||||||
let mut mono = Systick::new(systick, 12_000_000);
|
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))
|
(Shared {}, Local {}, init::Monotonics(mono))
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ mod app {
|
||||||
fn bar(_cx: bar::Context, instant: <MyMono as rtic_monotonic::Monotonic>::Instant) {
|
fn bar(_cx: bar::Context, instant: <MyMono as rtic_monotonic::Monotonic>::Instant) {
|
||||||
hprintln!("bar {:?}", instant).ok();
|
hprintln!("bar {:?}", instant).ok();
|
||||||
|
|
||||||
// Spawn a new message with 1s offset to spawned time
|
// Spawn a new message with 200ms offset to spawned time
|
||||||
let next_instant = instant + 1.secs();
|
let next_instant = instant + 200.millis();
|
||||||
foo::spawn_at(next_instant, next_instant).unwrap();
|
foo::spawn_at(next_instant, next_instant).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ mod app {
|
||||||
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
|
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
|
||||||
let mono = Systick::new(systick, 12_000_000);
|
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))
|
(Shared {}, Local {}, init::Monotonics(mono))
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ mod app {
|
||||||
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
|
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
|
||||||
}
|
}
|
||||||
|
|
||||||
// Periodic ever 1 seconds
|
// Periodic every 100ms
|
||||||
foo::spawn_after(1.secs()).unwrap();
|
foo::spawn_after(100.millis()).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue