better TRNG debug support

This commit is contained in:
bunnie 2023-03-13 17:17:33 +08:00
parent 8aa538008d
commit afb39f9a0c

View file

@ -794,7 +794,9 @@ fn main() -> ! {
let mut error_cb_conns: [Option<ScalarCallback>; 32] = [None; 32];
loop {
let mut msg = xous::receive_message(trng_sid).unwrap();
match FromPrimitive::from_usize(msg.body.id()) {
let op: Option<api::Opcode> = FromPrimitive::from_usize(msg.body.id());
log::debug!("{:?}", op);
match op {
Some(api::Opcode::GetTrng) => xous::msg_blocking_scalar_unpack!(msg, count, _, _, _, {
let val: [u32; 2] = trng.get_trng(count);
xous::return_scalar2(msg.sender, val[0] as _, val[1] as _)