diff --git a/Cargo.lock b/Cargo.lock index b9b488f5..164a54de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "ledger_device_sdk" -version = "1.13.1" +version = "1.14.1" dependencies = [ "const-zero", "include_gif", @@ -489,7 +489,7 @@ dependencies = [ [[package]] name = "ledger_secure_sdk_sys" -version = "1.4.3" +version = "1.4.4" dependencies = [ "bindgen", "cc", diff --git a/ledger_device_sdk/Cargo.toml b/ledger_device_sdk/Cargo.toml index 653c8dae..872d6068 100644 --- a/ledger_device_sdk/Cargo.toml +++ b/ledger_device_sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ledger_device_sdk" -version = "1.14.0" +version = "1.14.1" authors = ["yhql", "yogh333", "agrojean-ledger", "kingofpayne"] edition = "2021" license.workspace = true @@ -21,13 +21,11 @@ rand_core = { version = "0.6.3", default_features = false } zeroize = { version = "1.6.0", default_features = false } numtoa = "0.2.4" const-zero = "0.1.1" - -[target.'cfg(target_os="nanos")'.dependencies] -ledger_secure_sdk_sys = {path = "../ledger_secure_sdk_sys", version = "1.4.3"} - -[target.'cfg(not(target_os="nanos"))'.dependencies] -ledger_secure_sdk_sys = {path = "../ledger_secure_sdk_sys", version = "1.4.3", features = ["heap"]} +ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.4.4" } [features] speculos = [] ccid = [] +heap = [ "ledger_secure_sdk_sys/heap" ] + +default = [ "heap" ] diff --git a/ledger_secure_sdk_sys/Cargo.toml b/ledger_secure_sdk_sys/Cargo.toml index 168fc85f..d6a93f15 100644 --- a/ledger_secure_sdk_sys/Cargo.toml +++ b/ledger_secure_sdk_sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ledger_secure_sdk_sys" -version = "1.4.3" +version = "1.4.4" authors = ["yhql", "agrojean-ledger"] edition = "2021" license.workspace = true diff --git a/ledger_secure_sdk_sys/src/lib.rs b/ledger_secure_sdk_sys/src/lib.rs index 64c97d95..c3f06b13 100644 --- a/ledger_secure_sdk_sys/src/lib.rs +++ b/ledger_secure_sdk_sys/src/lib.rs @@ -4,7 +4,7 @@ #![allow(non_snake_case)] use core::ffi::c_void; -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] use core::mem::MaybeUninit; pub mod buttons; @@ -35,22 +35,22 @@ pub fn pic_rs_mut(x: &mut T) -> &mut T { unsafe { &mut *ptr } } -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] use critical_section::RawRestoreState; -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] use embedded_alloc::Heap; -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] #[global_allocator] static HEAP: Heap = Heap::empty(); -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] struct CriticalSection; -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] critical_section::set_impl!(CriticalSection); /// Default empty implementation as we don't have concurrency. -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] unsafe impl critical_section::Impl for CriticalSection { unsafe fn acquire() -> RawRestoreState {} unsafe fn release(_restore_state: RawRestoreState) {} @@ -61,7 +61,7 @@ unsafe impl critical_section::Impl for CriticalSection { /// The heap is stored in the stack, and has a fixed size. /// This method is called just before [sample_main]. #[no_mangle] -#[cfg(feature = "heap")] +#[cfg(all(feature = "heap", not(target_os = "nanos")))] extern "C" fn heap_init() { const HEAP_SIZE: usize = 8192; static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; @@ -69,7 +69,7 @@ extern "C" fn heap_init() { } #[no_mangle] -#[cfg(not(feature = "heap"))] +#[cfg(any(not(feature = "heap"), target_os = "nanos"))] extern "C" fn heap_init() {} include!(concat!(env!("OUT_DIR"), "/bindings.rs"));