1
0
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:
tychovrahe 2023-06-09 23:21:13 +02:00
parent bb94fa71e1
commit 4a51bb9fc7

View File

@ -22,11 +22,13 @@ use crate::{
}, },
}; };
use super::{theme, Loader, LoaderMsg};
use crate::{ use crate::{
trezorhal::{buffers::BufferJpegWork, uzlib::UZLIB_WINDOW_SIZE}, trezorhal::{ble::start_advertising, buffers::BufferJpegWork, uzlib::UZLIB_WINDOW_SIZE},
ui::{ ui::{
constant::HEIGHT, constant::HEIGHT,
display::tjpgd::BufferInput, display::tjpgd::BufferInput,
event::{ButtonEvent, PhysicalButton},
model_tt::component::homescreen::render::{ model_tt::component::homescreen::render::{
HomescreenJpeg, HomescreenToif, HOMESCREEN_TOIF_SIZE, HomescreenJpeg, HomescreenToif, HOMESCREEN_TOIF_SIZE,
}, },
@ -37,8 +39,6 @@ use render::{
HOMESCREEN_IMAGE_HEIGHT, HOMESCREEN_IMAGE_WIDTH, HOMESCREEN_IMAGE_HEIGHT, HOMESCREEN_IMAGE_WIDTH,
}; };
use super::{theme, Loader, LoaderMsg};
const AREA: Rect = constant::screen(); const AREA: Rect = constant::screen();
const TOP_CENTER: Point = AREA.top_center(); const TOP_CENTER: Point = AREA.top_center();
const LABEL_Y: i16 = HEIGHT - 18; 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> { fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
Self::event_usb(self, ctx, event); Self::event_usb(self, ctx, event);
if self.hold_to_lock { 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 { } else {
None None
} }