mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-07 22:10:57 +00:00
fixup! feat(core): expose BLE functionality to rust
This commit is contained in:
parent
0e12ea1e3a
commit
1e422dd8bb
@ -35,6 +35,7 @@ const DEFAULT_BINDGEN_MACROS_COMMON: &[&str] = &[
|
|||||||
"-I../../vendor/micropython/lib/uzlib",
|
"-I../../vendor/micropython/lib/uzlib",
|
||||||
"-I../rtl/inc",
|
"-I../rtl/inc",
|
||||||
"-I../gfx/inc",
|
"-I../gfx/inc",
|
||||||
|
"-I../io/ble/inc",
|
||||||
"-I../io/button/inc",
|
"-I../io/button/inc",
|
||||||
"-I../io/display/inc",
|
"-I../io/display/inc",
|
||||||
"-I../io/haptic/inc",
|
"-I../io/haptic/inc",
|
||||||
@ -51,6 +52,7 @@ const DEFAULT_BINDGEN_MACROS_COMMON: &[&str] = &[
|
|||||||
"-DUSE_TOUCH",
|
"-DUSE_TOUCH",
|
||||||
"-DUSE_HAPTIC",
|
"-DUSE_HAPTIC",
|
||||||
"-DUSE_RGB_LED",
|
"-DUSE_RGB_LED",
|
||||||
|
"-DUSE_BLE",
|
||||||
];
|
];
|
||||||
|
|
||||||
#[cfg(feature = "model_tt")]
|
#[cfg(feature = "model_tt")]
|
||||||
|
@ -4,23 +4,25 @@ use core::{
|
|||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
ops::{Deref, DerefMut},
|
ops::{Deref, DerefMut},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(feature = "touch")]
|
||||||
|
use crate::ui::{event::TouchEvent, geometry::Direction};
|
||||||
#[cfg(feature = "touch")]
|
#[cfg(feature = "touch")]
|
||||||
use num_traits::{FromPrimitive, ToPrimitive};
|
use num_traits::{FromPrimitive, ToPrimitive};
|
||||||
|
|
||||||
|
#[cfg(feature = "ble")]
|
||||||
|
use crate::micropython::buffer::get_buffer;
|
||||||
#[cfg(feature = "ble")]
|
#[cfg(feature = "ble")]
|
||||||
use crate::ui::event::BLEEvent;
|
use crate::ui::event::BLEEvent;
|
||||||
|
|
||||||
#[cfg(feature = "button")]
|
#[cfg(feature = "button")]
|
||||||
use crate::ui::event::ButtonEvent;
|
use crate::ui::event::ButtonEvent;
|
||||||
|
|
||||||
use crate::ui::{display::Color, shape::render_on_display};
|
|
||||||
|
|
||||||
#[cfg(feature = "touch")]
|
|
||||||
use crate::ui::{event::TouchEvent, geometry::Direction};
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::Error,
|
error::Error,
|
||||||
maybe_trace::MaybeTrace,
|
maybe_trace::MaybeTrace,
|
||||||
micropython::{
|
micropython::{
|
||||||
buffer::{get_buffer, StrBuffer},
|
buffer::StrBuffer,
|
||||||
gc::{self, Gc, GcBox},
|
gc::{self, Gc, GcBox},
|
||||||
macros::{obj_dict, obj_fn_1, obj_fn_2, obj_fn_3, obj_fn_var, obj_map, obj_type},
|
macros::{obj_dict, obj_fn_1, obj_fn_2, obj_fn_3, obj_fn_var, obj_map, obj_type},
|
||||||
map::Map,
|
map::Map,
|
||||||
@ -37,8 +39,9 @@ use crate::{
|
|||||||
base::{AttachType, TimerToken},
|
base::{AttachType, TimerToken},
|
||||||
Component, Event, EventCtx, Never,
|
Component, Event, EventCtx, Never,
|
||||||
},
|
},
|
||||||
display,
|
display::{self, Color},
|
||||||
event::USBEvent,
|
event::USBEvent,
|
||||||
|
shape::render_on_display,
|
||||||
ui_features::ModelUI,
|
ui_features::ModelUI,
|
||||||
UIFeaturesCommon,
|
UIFeaturesCommon,
|
||||||
},
|
},
|
||||||
@ -533,9 +536,8 @@ extern "C" fn ui_layout_ble_event(n_args: usize, args: *const Obj) -> Obj {
|
|||||||
return Err(Error::TypeError);
|
return Err(Error::TypeError);
|
||||||
}
|
}
|
||||||
let this: Gc<LayoutObj> = args[0].try_into()?;
|
let this: Gc<LayoutObj> = args[0].try_into()?;
|
||||||
let data: Obj = args[2].try_into()?;
|
|
||||||
|
|
||||||
let data = unsafe { get_buffer(data) };
|
let data = unsafe { get_buffer(args[2]) };
|
||||||
|
|
||||||
let data = unwrap!(data);
|
let data = unwrap!(data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user