Skip to content

Commit

Permalink
Activate BT on Stax OK
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Sep 26, 2024
1 parent efa1939 commit a87eade
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ledger_device_sdk/src/io.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(target_os = "nanox")]
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
use crate::ble;
#[cfg(not(any(target_os = "stax", target_os = "flex")))]
use ledger_secure_sdk_sys::buttons::{get_button_event, ButtonEvent, ButtonsState};
Expand Down Expand Up @@ -196,7 +196,7 @@ impl Comm {
APDU_USB_CCID => {
ccid::send(&self.apdu_buffer[..self.tx]);
}
#[cfg(target_os = "nanox")]
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
APDU_BLE => {
ble::send(&self.apdu_buffer[..self.tx]);
}
Expand Down Expand Up @@ -387,7 +387,7 @@ impl Comm {
}
seph::Events::CAPDUEvent => seph::handle_capdu_event(&mut self.apdu_buffer, spi_buffer),

#[cfg(target_os = "nanox")]
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
seph::Events::BleReceive => ble::receive(&mut self.apdu_buffer, spi_buffer),

seph::Events::TickerEvent => {
Expand Down
2 changes: 1 addition & 1 deletion ledger_device_sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![feature(generic_const_exprs)]
#![feature(cfg_version)]

#[cfg(target_os = "nanox")]
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
pub mod ble;

#[cfg(feature = "ccid")]
Expand Down
19 changes: 19 additions & 0 deletions ledger_secure_sdk_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,12 @@ impl SDKBuilder {
.to_str()
.unwrap(),
)
.header(
self.bolos_sdk
.join("lib_blewbxx_impl/include/ledger_ble.h")
.to_str()
.unwrap(),
)
}
_ => (),
}
Expand Down Expand Up @@ -745,6 +751,19 @@ fn finalize_flex_configuration(command: &mut cc::Build, bolos_sdk: &Path) {

command
.target("thumbv8m.main-none-eabi")
.file(bolos_sdk.join("src/ledger_protocol.c"))
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_gap_aci.c"))
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_gatt_aci.c"))
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_hal_aci.c"))
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_hci_le.c"))
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_l2cap_aci.c"))
.file(bolos_sdk.join("lib_blewbxx/core/template/osal.c"))
.file(bolos_sdk.join("lib_blewbxx_impl/src/ledger_ble.c"))
.include(bolos_sdk.join("lib_blewbxx/include"))
.include(bolos_sdk.join("lib_blewbxx/core"))
.include(bolos_sdk.join("lib_blewbxx/core/auto"))
.include(bolos_sdk.join("lib_blewbxx/core/template"))
.include(bolos_sdk.join("lib_blewbxx_impl/include"))
.include(bolos_sdk.join("target/flex/include/"))
.flag("-fropi")
.flag("-frwpi")
Expand Down
2 changes: 1 addition & 1 deletion ledger_secure_sdk_sys/src/c/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ int c_main(void) {

#ifdef HAVE_BLE
memset(&G_io_asynch_ux_callback, 0, sizeof(G_io_asynch_ux_callback));
LEDGER_BLE_init();
BLE_power(1, NULL);
#endif

#if !defined(HAVE_BOLOS) && defined(HAVE_PENDING_REVIEW_SCREEN)
Expand Down

0 comments on commit a87eade

Please sign in to comment.