xous-core/services/log-test-client/src/main.rs
Sean Cross eb7895d601 xous: add a return code to TerminateProcess
As part of this refactor, make `terminate_process()` a divergent call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00

22 lines
660 B
Rust

#![cfg_attr(target_os = "none", no_std)]
#![cfg_attr(target_os = "none", no_main)]
use xous::StringBuffer;
use core::fmt::Write;
#[xous::xous_main]
fn test_main() -> ! {
let connection = xous::connect(xous::SID::from_bytes(b"xous-log-server ").unwrap()).unwrap();
let mut log_string= StringBuffer::new();
for i in 0.. {
log_string.clear();
writeln!(log_string, "Hello, world! Loop {}", i).unwrap();
log_string.lend(connection, 1).unwrap();
log_string.lend_mut(connection, 1).unwrap();
log_string.lend(connection, 1).unwrap();
xous::yield_slice();
}
panic!("Finished an infinite loop");
}