Skip to content

Commit 80c6512

Browse files
committed
Forward all events to OS by default
1 parent 2670080 commit 80c6512

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub enum Event<T> {
9494
#[cfg(any(target_os = "stax", target_os = "flex"))]
9595
TouchEvent,
9696
/// Ticker
97-
Ticker,
97+
Ticker
9898
}
9999

100100
/// Manages the communication of the device: receives events such as button presses, incoming
@@ -411,10 +411,15 @@ 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+
{
420+
crate::uxapp::UxEvent::Event.request();
421+
}
422+
418423
}
419424
}
420425
None
@@ -598,15 +603,15 @@ fn handle_bolos_apdu(com: &mut Comm, ins: u8) {
598603
(260 - com.tx - 1) as u32,
599604
);
600605
com.apdu_buffer[com.tx] = len as u8;
601-
com.tx += (1 + len) as usize;
606+
com.tx += 1 + (len as usize);
602607

603608
let len = os_registry_get_current_app_tag(
604609
BOLOS_TAG_APPVERSION,
605610
&mut com.apdu_buffer[com.tx + 1] as *mut u8,
606611
(260 - com.tx - 1) as u32,
607612
);
608613
com.apdu_buffer[com.tx] = len as u8;
609-
com.tx += (1 + len) as usize;
614+
com.tx += 1 + (len as usize);
610615

611616
// to be fixed within io tasks
612617
// 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)