Skip to content

Commit 1b954a6

Browse files
committed
Merge commit 'refs/pull/1159/head' of https://github.com/digitalbitbox/bitbox02-firmware
2 parents 460c7bd + 2483900 commit 1b954a6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ add_custom_target(rust-bindgen
395395
--allowlist-function secp256k1_ecdsa_anti_exfil_host_commit
396396
--allowlist-function wally_get_secp_context
397397
--allowlist-function wally_hash160
398+
--allowlist-function printf
398399
${CMAKE_CURRENT_SOURCE_DIR}/rust/bitbox02-sys/wrapper.h --
399400
-DPB_NO_PACKED_STRUCTS=1 -DPB_FIELD_16BIT=1 -fshort-enums ${RUST_BINDGEN_FLAGS} ${RUST_INCLUDES}
400401
COMMAND

src/rust/bitbox02/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ pub fn reboot() -> ! {
176176
panic!("reboot called")
177177
}
178178

179+
#[cfg(feature = "testing")]
180+
pub fn print_stdout(msg: &str) {
181+
unsafe {
182+
bitbox02_sys::printf(crate::util::str_to_cstr_vec(msg).unwrap().as_ptr());
183+
}
184+
}
185+
179186
#[cfg(test)]
180187
mod tests {
181188
use super::*;

0 commit comments

Comments
 (0)