From 9059d939e4ab717c8ba973160d12905ab9755e4e Mon Sep 17 00:00:00 2001 From: Alexis Grojean Date: Mon, 27 May 2024 12:17:12 +0200 Subject: [PATCH] Clean up. --- ledger_device_sdk/src/io.rs | 22 +--------------------- ledger_secure_sdk_sys/build.rs | 1 - ledger_secure_sdk_sys/sdk_flex.h | 4 +--- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/ledger_device_sdk/src/io.rs b/ledger_device_sdk/src/io.rs index 8e5bc0c8..45d4bb56 100644 --- a/ledger_device_sdk/src/io.rs +++ b/ledger_device_sdk/src/io.rs @@ -249,13 +249,6 @@ impl Comm { T: TryFrom, Reply: From<>::Error>, { - // if self.event_pending { - // self.event_pending = false; - // if let Some(value) = self.check_event() { - // return value; - // } - // } - let mut spi_buffer = [0u8; 128]; unsafe { @@ -285,27 +278,14 @@ impl Comm { T: TryFrom, Reply: From<>::Error>, { - // if self.event_pending { - // let event: Option> = self.check_event(); - // if event.is_some() { - // return true; - // } - // } - let mut spi_buffer = [0u8; 128]; - // unsafe { - // G_io_app.apdu_state = APDU_IDLE; - // G_io_app.apdu_media = IO_APDU_MEDIA_NONE; - // G_io_app.apdu_length = 0; - // } - // Signal end of command stream from SE to MCU // And prepare reception if !sys_seph::is_status_sent() { sys_seph::send_general_status(); } - // Fetch the next message from the MCU } + // Fetch the next message from the MCU let _rx = sys_seph::seph_recv(&mut spi_buffer, 0); return self.detect_apdu::(&mut spi_buffer); } diff --git a/ledger_secure_sdk_sys/build.rs b/ledger_secure_sdk_sys/build.rs index 899add4b..9133db40 100644 --- a/ledger_secure_sdk_sys/build.rs +++ b/ledger_secure_sdk_sys/build.rs @@ -140,7 +140,6 @@ fn retrieve_sdk_git_info(bolos_sdk: &Path) -> (String, String) { } fn retrieve_makefile_infos(bolos_sdk: &Path) -> Result<(Option, String), SDKBuildError> { - println!("SDK path: {:?}", bolos_sdk); let makefile_defines = File::open(bolos_sdk.join("Makefile.defines")).expect("Could not find Makefile.defines"); let mut api_level: Option = None; diff --git a/ledger_secure_sdk_sys/sdk_flex.h b/ledger_secure_sdk_sys/sdk_flex.h index e1847973..08ca2376 100644 --- a/ledger_secure_sdk_sys/sdk_flex.h +++ b/ledger_secure_sdk_sys/sdk_flex.h @@ -21,6 +21,4 @@ #define __IO volatile #define IO_USB_MAX_ENDPOINTS 6 #define IO_SEPROXYHAL_BUFFER_SIZE_B 128 -#define main _start - - +#define main _start \ No newline at end of file