Skip to content

Commit a2979b1

Browse files
committed
More explicit #[cfg] according to the targeted device
1 parent ce5e606 commit a2979b1

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

ledger_device_sdk/src/io.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(not(any(target_os = "stax", target_os = "flex", target_os = "apex_p")))]
1+
#[cfg(any(target_os = "nanosplus", target_os = "nanox"))]
22
use ledger_secure_sdk_sys::buttons::{get_button_event, ButtonEvent, ButtonsState};
33
use ledger_secure_sdk_sys::seph as sys_seph;
44
use ledger_secure_sdk_sys::*;
@@ -106,7 +106,7 @@ pub enum Event<T> {
106106
/// APDU event
107107
Command(T),
108108
/// Button press or release event
109-
#[cfg(not(any(target_os = "stax", target_os = "flex", target_os = "apex_p")))]
109+
#[cfg(any(target_os = "nanosplus", target_os = "nanox"))]
110110
Button(ButtonEvent),
111111
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p"))]
112112
TouchEvent,
@@ -121,7 +121,7 @@ pub struct Comm {
121121
pub rx: usize,
122122
pub tx: usize,
123123
pub event_pending: bool,
124-
#[cfg(not(any(target_os = "stax", target_os = "flex", target_os = "apex_p")))]
124+
#[cfg(any(target_os = "nanosplus", target_os = "nanox"))]
125125
buttons: ButtonsState,
126126
/// Expected value for the APDU CLA byte.
127127
/// If defined, [`Comm`] will automatically reply with [`StatusWords::BadCla`] when an APDU
@@ -162,7 +162,7 @@ impl Comm {
162162
rx: 0,
163163
tx: 0,
164164
event_pending: false,
165-
#[cfg(not(any(target_os = "stax", target_os = "flex", target_os = "apex_p")))]
165+
#[cfg(any(target_os = "nanosplus", target_os = "nanox"))]
166166
buttons: ButtonsState::new(),
167167
expected_cla: None,
168168
apdu_type: seph::PacketTypes::PacketTypeNone as u8,
@@ -358,7 +358,7 @@ impl Comm {
358358

359359
match seph::Events::from(tag) {
360360
// BUTTON PUSH EVENT
361-
#[cfg(not(any(target_os = "stax", target_os = "flex", target_os = "apex_p")))]
361+
#[cfg(any(target_os = "nanosplus", target_os = "nanox"))]
362362
seph::Events::ButtonPushEvent => {
363363
#[cfg(feature = "nano_nbgl")]
364364
unsafe {

ledger_device_sdk/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ pub mod testing;
2626
feature = "nano_nbgl"
2727
))]
2828
pub mod nbgl;
29-
#[cfg(not(any(
30-
target_os = "stax",
31-
target_os = "flex",
32-
target_os = "apex_p",
33-
feature = "nano_nbgl"
34-
)))]
29+
#[cfg(all(
30+
any(target_os = "nanosplus", target_os = "nanox"),
31+
not(feature = "nano_nbgl")
32+
))]
3533
pub mod ui;
3634

3735
pub mod uxapp;

0 commit comments

Comments
 (0)