Add ticktimer test client

This commit is contained in:
eupn 2023-04-05 16:37:55 +04:00
parent 6ac2713f0a
commit d55ea419b2
No known key found for this signature in database
GPG key ID: 6A550BE33BE768A9
3 changed files with 37 additions and 0 deletions

View 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 = []

View file

@ -0,0 +1 @@
# `xous-ticktimer` test client

View 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");
}