mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
Add ticktimer test client
This commit is contained in:
parent
6ac2713f0a
commit
d55ea419b2
3 changed files with 37 additions and 0 deletions
15
services/ticktimer-test-client/Cargo.toml
Normal file
15
services/ticktimer-test-client/Cargo.toml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[package]
|
||||||
|
authors = ["Sean Cross <sean@xobs.io>"]
|
||||||
|
description = "Program to test the log server"
|
||||||
|
edition = "2021"
|
||||||
|
name = "ticktimer-test-client"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
# Dependency versions enforced by Cargo.lock.
|
||||||
|
[dependencies]
|
||||||
|
xous = "0.9.28"
|
||||||
|
log = "0.4.14"
|
||||||
|
log-server = {package = "xous-api-log", version = "0.1.22"}
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
1
services/ticktimer-test-client/README.md
Normal file
1
services/ticktimer-test-client/README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
# `xous-ticktimer` test client
|
||||||
21
services/ticktimer-test-client/src/main.rs
Normal file
21
services/ticktimer-test-client/src/main.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#![cfg_attr(target_os = "none", no_std)]
|
||||||
|
#![cfg_attr(target_os = "none", no_main)]
|
||||||
|
|
||||||
|
use log::info;
|
||||||
|
use std::thread::sleep;
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
|
fn main() -> ! {
|
||||||
|
log_server::init_wait().unwrap();
|
||||||
|
log::set_max_level(log::LevelFilter::Trace);
|
||||||
|
info!("my PID is {}", xous::process::id());
|
||||||
|
|
||||||
|
const DELAY_MS: u64 = 5000;
|
||||||
|
|
||||||
|
for i in 0.. {
|
||||||
|
info!("Loop #{}, waiting {} ms", i, DELAY_MS);
|
||||||
|
sleep(Duration::from_millis(DELAY_MS));
|
||||||
|
}
|
||||||
|
|
||||||
|
panic!("Finished endless loop");
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue