print syscall

This commit is contained in:
sawyer committed 2025-08-29 15:05:19 -06:00
1 parent f3c67beb00
commit 1bbd988ef7
4 files changed
+26 -1

No files matched your search

+10
View File
@@ -28,5 +28,15 @@ pub extern "C" fn call_abi(call: *const Syscall) {
.draw_iter(slice.iter().copied())
.unwrap();
}
Syscall::Print { msg, len } => {
// SAFETY: we're trusting the user program here
let slice = unsafe { core::slice::from_raw_parts(*msg, *len) };
if let Ok(str) = str::from_utf8(slice) {
defmt::info!("{:?}", str);
} else {
defmt::error!("Failed to parse user print str")
}
}
}
}