Skip to content

Commit 58c6b76

Browse files
authored
Merge pull request #267 from LedgerHQ/y333/fix_pin_lock_usb_disconnect
Forward all events to OS by default
2 parents 2670080 + d708a58 commit 58c6b76

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ledger_device_sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ledger_device_sdk"
3-
version = "1.22.9"
3+
version = "1.22.10"
44
authors = ["yhql", "yogh333", "agrojean-ledger", "kingofpayne"]
55
edition = "2021"
66
license.workspace = true

ledger_device_sdk/src/io.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,14 @@ impl Comm {
411411
},
412412

413413
_ => {
414-
#[cfg(any(target_os = "stax", target_os = "flex"))]
414+
#[cfg(any(target_os = "stax", target_os = "flex", feature = "nano_nbgl"))]
415415
unsafe {
416416
ux_process_default_event();
417417
}
418+
#[cfg(any(target_os = "nanox", target_os = "nanosplus"))]
419+
if !cfg!(feature = "nano_nbgl") {
420+
crate::uxapp::UxEvent::Event.request();
421+
}
418422
}
419423
}
420424
None
@@ -598,15 +602,15 @@ fn handle_bolos_apdu(com: &mut Comm, ins: u8) {
598602
(260 - com.tx - 1) as u32,
599603
);
600604
com.apdu_buffer[com.tx] = len as u8;
601-
com.tx += (1 + len) as usize;
605+
com.tx += 1 + (len as usize);
602606

603607
let len = os_registry_get_current_app_tag(
604608
BOLOS_TAG_APPVERSION,
605609
&mut com.apdu_buffer[com.tx + 1] as *mut u8,
606610
(260 - com.tx - 1) as u32,
607611
);
608612
com.apdu_buffer[com.tx] = len as u8;
609-
com.tx += (1 + len) as usize;
613+
com.tx += 1 + (len as usize);
610614

611615
// to be fixed within io tasks
612616
// return OS flags to notify of platform's global state (pin lock etc)

ledger_device_sdk/src/seph.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub enum Events {
1515
USBEventResume = SEPROXYHAL_TAG_USB_EVENT_RESUMED as u8,
1616
CAPDUEvent = SEPROXYHAL_TAG_CAPDU_EVENT as u8,
1717
TickerEvent = SEPROXYHAL_TAG_TICKER_EVENT as u8,
18+
StatusEvent = SEPROXYHAL_TAG_STATUS_EVENT as u8,
1819
ButtonPush = SEPROXYHAL_TAG_BUTTON_PUSH_EVENT as u8,
1920
DisplayProcessed = SEPROXYHAL_TAG_DISPLAY_PROCESSED_EVENT as u8,
2021
BleReceive = SEPROXYHAL_TAG_BLE_RECV_EVENT as u8,
@@ -42,6 +43,7 @@ impl From<u8> for Events {
4243
SEPROXYHAL_TAG_USB_EVENT_RESUMED => Events::USBEventResume,
4344
SEPROXYHAL_TAG_CAPDU_EVENT => Events::CAPDUEvent,
4445
SEPROXYHAL_TAG_TICKER_EVENT => Events::TickerEvent,
46+
SEPROXYHAL_TAG_STATUS_EVENT => Events::StatusEvent,
4547
SEPROXYHAL_TAG_BUTTON_PUSH_EVENT => Events::ButtonPush,
4648
SEPROXYHAL_TAG_DISPLAY_PROCESSED_EVENT => Events::DisplayProcessed,
4749
SEPROXYHAL_TAG_BLE_RECV_EVENT => Events::BleReceive,

0 commit comments

Comments
 (0)