Skip to content

Commit

Permalink
Merge pull request #99 from LedgerHQ/y333_17122024/migration_to_updat…
Browse files Browse the repository at this point in the history
…ed_nightly

Y333 17122024/migration to updated nightly
  • Loading branch information
yogh333 authored Jan 6, 2025
2 parents b14b3a9 + 4a60095 commit 180974a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "app-boilerplate-rust"
version = "1.6.2"
version = "1.6.3"
authors = ["yhql", "agrojean-ledger"]
edition = "2021"

[dependencies]
ledger_device_sdk = "1.18.4"
ledger_device_sdk = "1.19.1"
include_gif = "1.2.0"
serde = {version="1.0.192", default_features = false, features = ["derive"]}
serde-json-core = { git = "https://github.com/rust-embedded-community/serde-json-core"}
Expand Down Expand Up @@ -37,3 +37,6 @@ icon = "crab_32x32.gif"

[package.metadata.ledger.flex]
icon = "crab_40x40.gif"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("stax", "flex", "nanos", "nanox", "nanosplus"))'] }
12 changes: 8 additions & 4 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,30 @@ 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;
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;
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]
}

#[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 {
Expand Down
Binary file modified tests/snapshots/flex/test_app_mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/stax/test_app_mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 180974a

Please sign in to comment.