mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
TEST: start advertising
This commit is contained in:
parent
bb94fa71e1
commit
4a51bb9fc7
@ -22,11 +22,13 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
use super::{theme, Loader, LoaderMsg};
|
||||
use crate::{
|
||||
trezorhal::{buffers::BufferJpegWork, uzlib::UZLIB_WINDOW_SIZE},
|
||||
trezorhal::{ble::start_advertising, buffers::BufferJpegWork, uzlib::UZLIB_WINDOW_SIZE},
|
||||
ui::{
|
||||
constant::HEIGHT,
|
||||
display::tjpgd::BufferInput,
|
||||
event::{ButtonEvent, PhysicalButton},
|
||||
model_tt::component::homescreen::render::{
|
||||
HomescreenJpeg, HomescreenToif, HOMESCREEN_TOIF_SIZE,
|
||||
},
|
||||
@ -37,8 +39,6 @@ use render::{
|
||||
HOMESCREEN_IMAGE_HEIGHT, HOMESCREEN_IMAGE_WIDTH,
|
||||
};
|
||||
|
||||
use super::{theme, Loader, LoaderMsg};
|
||||
|
||||
const AREA: Rect = constant::screen();
|
||||
const TOP_CENTER: Point = AREA.top_center();
|
||||
const LABEL_Y: i16 = HEIGHT - 18;
|
||||
@ -203,7 +203,15 @@ impl Component for Homescreen {
|
||||
fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
|
||||
Self::event_usb(self, ctx, event);
|
||||
if self.hold_to_lock {
|
||||
Self::event_hold(self, ctx, event).then_some(HomescreenMsg::Dismissed)
|
||||
if Self::event_hold(self, ctx, event) {
|
||||
return Some(HomescreenMsg::Dismissed);
|
||||
}
|
||||
}
|
||||
|
||||
if let Event::Button(ButtonEvent::ButtonPressed(PhysicalButton::Power)) = event {
|
||||
start_advertising(false);
|
||||
None
|
||||
//Some(HomescreenMsg::Dismissed)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user