mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-26 09:52:39 +00:00
28 lines
913 B
Rust
28 lines
913 B
Rust
|
|
#![cfg_attr(target_os = "none", no_std)]
|
||
|
|
#![cfg_attr(target_os = "none", no_main)]
|
||
|
|
|
||
|
|
fn print_log_messages(log_message: &str, prefix: &str) {
|
||
|
|
log::info!("Got a message hook! Message: [{}], prefix: [{}]", log_message, prefix);
|
||
|
|
}
|
||
|
|
|
||
|
|
#[xous::xous_main]
|
||
|
|
fn rkyv_test_client() -> ! {
|
||
|
|
log_server::init_wait().unwrap();
|
||
|
|
log::info!(
|
||
|
|
"Hello, world! This is the client, PID {}",
|
||
|
|
xous::current_pid().unwrap().get()
|
||
|
|
);
|
||
|
|
let ticktimer_server_id = xous::SID::from_bytes(b"ticktimer-server").unwrap();
|
||
|
|
let ticktimer_conn = xous::connect(ticktimer_server_id).unwrap();
|
||
|
|
|
||
|
|
rkyv_test_server::hook_log_messages(print_log_messages);
|
||
|
|
|
||
|
|
let mut idx = 0;
|
||
|
|
loop {
|
||
|
|
log::info!("2 + {} = {}", idx, rkyv_test_server::add(2, idx).unwrap());
|
||
|
|
ticktimer_server::sleep_ms(ticktimer_conn, 500).ok();
|
||
|
|
rkyv_test_server::log_message("prefix", "Hi there");
|
||
|
|
idx += 1;
|
||
|
|
}
|
||
|
|
}
|