File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ use std::{env, path::PathBuf};
3
3
fn sdk_includes ( target : & str ) -> impl IntoIterator < Item = PathBuf > {
4
4
[
5
5
PathBuf :: from ( "include" ) ,
6
+ PathBuf :: from ( "io/include" ) ,
7
+ PathBuf :: from ( "io_legacy/include" ) ,
6
8
PathBuf :: from ( "target" ) . join ( target) . join ( "include" ) ,
7
9
PathBuf :: from ( "lib_ux" ) . join ( "include" ) ,
8
10
PathBuf :: from ( "lib_cxng" ) . join ( "include" ) ,
@@ -151,7 +153,7 @@ fn main() {
151
153
. map ( |path| format ! ( "-I{}" , path. display( ) ) ) ,
152
154
)
153
155
. clang_arg ( format ! ( "-I{}" , sdk_path. display( ) ) )
154
- . clang_arg ( format ! ( "-I{}/include" , sdk_path . display ( ) ) )
156
+ . clang_arg ( "-D OS_IO_SEPH_BUFFER_SIZE=272" )
155
157
. generate ( )
156
158
. expect ( "able to generate bindings" ) ;
157
159
bindings
Original file line number Diff line number Diff line change 1
- use std:: env;
1
+ use std:: { env, fs , path } ;
2
2
3
3
#[ derive( Debug , Clone , Copy ) ]
4
4
enum Device {
@@ -24,6 +24,11 @@ fn main() {
24
24
25
25
if let Some ( v) = env:: var_os ( "BOLOS_SDK" ) {
26
26
if !v. is_empty ( ) {
27
+ if let Ok ( contents) = fs:: read_to_string ( path:: Path :: new ( & v) . join ( "Makefile.defines" ) ) {
28
+ if contents. contains ( "REVAMPED_IO" ) {
29
+ println ! ( "cargo:rustc-cfg=revamped_io" ) ;
30
+ }
31
+ }
27
32
match detect_device ( ) . expect ( "invalid or unable to retrieve TARGET_NAME" ) {
28
33
Device :: NanoS => println ! ( "cargo:rustc-cfg=nanos" ) ,
29
34
Device :: NanoX => println ! ( "cargo:rustc-cfg=nanox" ) ,
Original file line number Diff line number Diff line change @@ -42,7 +42,13 @@ impl Into<bindings::zxerr_t> for ViewError {
42
42
}
43
43
44
44
pub ( crate ) fn apdu_buffer_mut ( ) -> & ' static mut [ u8 ] {
45
- PIC :: new ( unsafe { & mut bolos_sys:: raw:: G_io_apdu_buffer } ) . into_inner ( )
45
+ PIC :: new ( unsafe {
46
+ cfg_if:: cfg_if! {
47
+ if #[ cfg( revamped_io) ] { & mut bolos_sys:: raw:: G_io_tx_buffer }
48
+ else { & mut bolos_sys:: raw:: G_io_apdu_buffer }
49
+ }
50
+ } )
51
+ . into_inner ( )
46
52
}
47
53
48
54
pub ( crate ) fn store_into < ' buf , T : Sized > (
You can’t perform that action at this time.
0 commit comments