diff --git a/Cargo.lock b/Cargo.lock index f9358e8c..e1064590 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,8 +333,6 @@ dependencies = [ [[package]] name = "include_gif" version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8511434ad4b61bf0be7c61707d0172b6ad091519da93bf95d66555f3f0d994ac" dependencies = [ "flate2", "image", @@ -370,9 +368,7 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "ledger_device_sdk" -version = "1.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12c7c689fd5a4a02e98140309a2a3ef403db727173410af2df6ee3cc596fe4d" +version = "1.19.0" dependencies = [ "const-zero", "include_gif", @@ -385,9 +381,7 @@ dependencies = [ [[package]] name = "ledger_secure_sdk_sys" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd839cd07d2d6549c037ac63cbe37f2ceb071c556d5145aa329e0d91412233f2" +version = "1.6.0" dependencies = [ "bindgen", "cc", diff --git a/Cargo.toml b/Cargo.toml index 6f666e86..a0854e3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,3 +37,10 @@ icon = "crab_32x32.gif" [package.metadata.ledger.flex] icon = "crab_40x40.gif" + +[patch.crates-io] +ledger_device_sdk = { path = "../ledger-device-rust-sdk/ledger_device_sdk" } +include_gif = { path = "../ledger-device-rust-sdk/include_gif" } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("stax", "flex", "nanos", "nanox", "nanosplus"))'] } diff --git a/src/settings.rs b/src/settings.rs index 9efa11e1..612b931e 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -20,18 +20,21 @@ impl Settings { #[inline(never)] #[allow(unused)] pub fn get_mut(&mut self) -> &mut AtomicStorage<[u8; SETTINGS_SIZE]> { - return unsafe { DATA.get_mut() }; + let data = &raw mut DATA; + return unsafe { (*data).get_mut() }; } #[inline(never)] #[allow(unused)] pub fn get_ref(&mut self) -> &AtomicStorage<[u8; SETTINGS_SIZE]> { - return unsafe { DATA.get_ref() }; + let data = &raw const DATA; + return unsafe { (*data).get_ref() }; } #[allow(unused)] pub fn get_element(&self, index: usize) -> u8 { - let storage = unsafe { DATA.get_ref() }; + let data = &raw const DATA; + let storage = unsafe { (*data).get_ref() }; let settings = storage.get_ref(); settings[index] } @@ -39,7 +42,8 @@ impl Settings { #[allow(unused)] // Not used in this boilerplate, but can be used to set a value in the settings pub fn set_element(&self, index: usize, value: u8) { - let storage = unsafe { DATA.get_mut() }; + let data = &raw mut DATA; + let storage = unsafe { (*data).get_mut() }; let mut updated_data = *storage.get_ref(); updated_data[index] = value; unsafe {