Skip to content

Commit 94fb4ba

Browse files
committed
Rename NBGL feature for Nano devices
1 parent 69a34ab commit 94fb4ba

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

ledger_device_sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.7.1" }
2727
debug = []
2828
speculos = []
2929
heap = [ "ledger_secure_sdk_sys/heap" ]
30-
nbgl = [ "ledger_secure_sdk_sys/nbgl" ]
30+
nano_nbgl = [ "ledger_secure_sdk_sys/nano_nbgl" ]
3131

3232
default = [ "heap" ]
3333

ledger_device_sdk/src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl Comm {
372372
match seph::Events::from(tag) {
373373
#[cfg(not(any(target_os = "stax", target_os = "flex")))]
374374
seph::Events::ButtonPush => {
375-
#[cfg(feature = "nbgl")]
375+
#[cfg(feature = "nano_nbgl")]
376376
unsafe {
377377
ux_process_button_event(spi_buffer.as_mut_ptr());
378378
}

ledger_device_sdk/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ pub mod seph;
2222

2323
pub mod testing;
2424

25-
#[cfg(any(target_os = "stax", target_os = "flex", feature = "nbgl"))]
25+
#[cfg(any(target_os = "stax", target_os = "flex", feature = "nano_nbgl"))]
2626
pub mod nbgl;
27-
#[cfg(not(any(target_os = "stax", target_os = "flex", feature = "nbgl")))]
27+
#[cfg(not(any(target_os = "stax", target_os = "flex", feature = "nano_nbgl")))]
2828
pub mod ui;
2929

3030
pub mod uxapp;

ledger_device_sdk/src/nbgl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use ledger_secure_sdk_sys::*;
1010

1111
pub mod nbgl_address_review;
1212
pub mod nbgl_choice;
13-
#[cfg(any(target_os = "stax", target_os = "flex"))]
1413
pub mod nbgl_generic_review;
1514
pub mod nbgl_home_and_settings;
1615
pub mod nbgl_review;
@@ -21,7 +20,6 @@ pub mod nbgl_streaming_review;
2120

2221
pub use nbgl_address_review::*;
2322
pub use nbgl_choice::*;
24-
#[cfg(any(target_os = "stax", target_os = "flex"))]
2523
pub use nbgl_generic_review::*;
2624
pub use nbgl_home_and_settings::*;
2725
pub use nbgl_review::*;

ledger_secure_sdk_sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ critical-section = { version = "1.1.2", optional = true }
1818

1919
[features]
2020
heap = ["dep:embedded-alloc", "dep:critical-section"]
21-
nbgl = []
21+
nano_nbgl = []
2222

2323
[lints.rust.unexpected_cfgs]
2424
level = "warn"

ledger_secure_sdk_sys/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl SDKBuilder<'_> {
222222
target: "thumbv8m.main-none-eabi",
223223
defines: {
224224
let mut v = header2define("csdk_nanos2.h");
225-
if env::var_os("CARGO_FEATURE_NBGL").is_some() {
225+
if env::var_os("CARGO_FEATURE_NANO_NBGL").is_some() {
226226
println!("cargo:warning=NBGL is built");
227227
v.push((String::from("HAVE_NBGL"), None));
228228
v.push((String::from("NBGL_STEP"), None));
@@ -245,7 +245,7 @@ impl SDKBuilder<'_> {
245245
target: "thumbv6m-none-eabi",
246246
defines: {
247247
let mut v = header2define("csdk_nanox.h");
248-
if env::var_os("CARGO_FEATURE_NBGL").is_some() {
248+
if env::var_os("CARGO_FEATURE_NANO_NBGL").is_some() {
249249
println!("cargo:warning=NBGL is built");
250250
v.push((String::from("HAVE_NBGL"), None));
251251
v.push((String::from("NBGL_STEP"), None));
@@ -537,7 +537,7 @@ impl SDKBuilder<'_> {
537537
DeviceName::NanoSPlus | DeviceName::NanoX | DeviceName::Stax | DeviceName::Flex => {
538538
if ((self.device.name == DeviceName::NanoX
539539
|| self.device.name == DeviceName::NanoSPlus)
540-
&& env::var_os("CARGO_FEATURE_NBGL").is_some())
540+
&& env::var_os("CARGO_FEATURE_NANO_NBGL").is_some())
541541
|| self.device.name == DeviceName::Stax
542542
|| self.device.name == DeviceName::Flex
543543
{

0 commit comments

Comments
 (0)