diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1adcc89496..bda608b112 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -395,6 +395,7 @@ add_custom_target(rust-bindgen --allowlist-function secp256k1_ecdsa_anti_exfil_host_commit --allowlist-function wally_get_secp_context --allowlist-function wally_hash160 + --allowlist-function printf ${CMAKE_CURRENT_SOURCE_DIR}/rust/bitbox02-sys/wrapper.h -- -DPB_NO_PACKED_STRUCTS=1 -DPB_FIELD_16BIT=1 -fshort-enums ${RUST_BINDGEN_FLAGS} ${RUST_INCLUDES} COMMAND diff --git a/src/rust/bitbox02/src/lib.rs b/src/rust/bitbox02/src/lib.rs index c059035494..638640bf86 100644 --- a/src/rust/bitbox02/src/lib.rs +++ b/src/rust/bitbox02/src/lib.rs @@ -176,6 +176,12 @@ pub fn reboot() -> ! { panic!("reboot called") } +pub fn print_stdout(msg: &str) { + unsafe { + bitbox02_sys::printf(crate::util::str_to_cstr_vec(msg).unwrap().as_ptr()); + } +} + #[cfg(test)] mod tests { use super::*;